diff --git a/go.mod b/go.mod index f9a8aef80e..6b869fca13 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 github.com/containerd/cgroups/v3 v3.0.2 github.com/containerd/console v1.0.3 - github.com/containerd/containerd v1.7.3 + github.com/containerd/containerd v1.7.0 github.com/containerd/errdefs v0.1.0 github.com/containerd/go-runc v1.0.0 github.com/containerd/protobuild v0.3.0 @@ -45,7 +45,7 @@ require ( github.com/OneOfOne/xxhash v1.2.8 // indirect github.com/agnivade/levenshtein v1.0.1 // indirect github.com/akavel/rsrc v0.10.2 // indirect - github.com/containerd/continuity v0.4.1 // indirect + github.com/containerd/continuity v0.4.2 // indirect github.com/containerd/fifo v1.1.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect diff --git a/go.sum b/go.sum index bacd77db2d..22f91ea4d5 100644 --- a/go.sum +++ b/go.sum @@ -231,8 +231,8 @@ github.com/containerd/containerd v1.5.7/go.mod h1:gyvv6+ugqY25TiXxcZC3L5yOeYgEw0 github.com/containerd/containerd v1.5.8/go.mod h1:YdFSv5bTFLpG2HIYmfqDpSYYTDX+mc5qtSuYx1YUb/s= github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0NpumIq9ODB0kLtoE= github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0Nltt5QE4OMNk0= -github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o= -github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8= +github.com/containerd/containerd v1.7.0 h1:G/ZQr3gMZs6ZT0qPUZ15znx5QSdQdASW11nXTLTM2Pg= +github.com/containerd/containerd v1.7.0/go.mod h1:QfR7Efgb/6X2BDpTPJRvPTYDE9rsF0FsXX9J8sIs/sc= github.com/containerd/continuity v0.0.0-20190426062206-aaeac12a7ffc/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= @@ -241,8 +241,8 @@ github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7/go.mod h1:kR github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ= github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= -github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU= -github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= +github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= diff --git a/test/go.mod b/test/go.mod index e771b990a2..a9871fbc63 100644 --- a/test/go.mod +++ b/test/go.mod @@ -4,9 +4,9 @@ go 1.18 require ( github.com/Microsoft/go-winio v0.6.1 - github.com/Microsoft/hcsshim v0.10.0-rc.8 + github.com/Microsoft/hcsshim v0.11.4 github.com/containerd/cgroups/v3 v3.0.2 - github.com/containerd/containerd v1.7.3 + github.com/containerd/containerd v1.7.0 github.com/containerd/errdefs v0.1.0 github.com/containerd/go-runc v1.0.0 github.com/containerd/ttrpc v1.2.2 @@ -24,12 +24,12 @@ require ( golang.org/x/sys v0.17.0 google.golang.org/grpc v1.62.0 google.golang.org/protobuf v1.32.0 - k8s.io/cri-api v0.27.1 + k8s.io/cri-api v0.26.2 ) require ( - github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 // indirect - github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652 // indirect + github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect + github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect github.com/Microsoft/cosesign1go v1.1.0 // indirect github.com/Microsoft/didx509go v0.0.2 // indirect github.com/OneOfOne/xxhash v1.2.8 // indirect @@ -38,12 +38,11 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/container-orchestrated-devices/container-device-interface v0.5.4 // indirect github.com/containerd/console v1.0.3 // indirect - github.com/containerd/continuity v0.4.1 // indirect + github.com/containerd/continuity v0.4.2 // indirect github.com/containerd/fifo v1.1.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect github.com/containerd/typeurl/v2 v2.1.1 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect - github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/docker/cli v24.0.0+incompatible // indirect github.com/docker/distribution v2.8.2+incompatible // indirect diff --git a/test/go.sum b/test/go.sum index cf60b1a65d..86c6b62e83 100644 --- a/test/go.sum +++ b/test/go.sum @@ -1193,10 +1193,12 @@ gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zum git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/AdaLogics/go-fuzz-headers v0.0.0-20221206110420-d395f97c4830/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0= -github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1 h1:EKPd1INOIyr5hWOWhvpmQpY6tKjeG0hT1s3AMC/9fic= github.com/AdaLogics/go-fuzz-headers v0.0.0-20230106234847-43070de90fa1/go.mod h1:VzwV+t+dZ9j/H867F1M2ziD+yLHtB46oM35FxxMJ4d0= -github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652 h1:+vTEFqeoeur6XSq06bs+roX3YiT49gUniJK7Zky7Xjg= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9vkmnHYOMsOr4WLk+Vo07yKIzd94sVoIqshQ4bU= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20221215162035-5330a85ea652/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 h1:59MxjQVfjXsBpLy+dbd2/ELV5ofnUkUZBvWSC85sheA= +github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod h1:OahwfttHWG6eJ0clwcfBAHoDI6X/LV/15hx/wlMZSrU= github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v56.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= @@ -1236,6 +1238,7 @@ github.com/Microsoft/go-winio v0.4.17-0.20210324224401-5516f17a5958/go.mod h1:JP github.com/Microsoft/go-winio v0.4.17/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.1/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY= +github.com/Microsoft/go-winio v0.6.0/go.mod h1:cTAf44im0RAYeL23bpB+fzCyDH2MJiz2BO69KH/soAE= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim/test v0.0.0-20201218223536-d3e5debf77da/go.mod h1:5hlzMzRKMLyo42nCZ9oml8AdTlq/0cvIaBv6tK1RehU= @@ -1377,8 +1380,8 @@ github.com/containerd/cgroups v0.0.0-20200824123100-0b889c03f102/go.mod h1:s5q4S github.com/containerd/cgroups v0.0.0-20210114181951-8a68de567b68/go.mod h1:ZJeTFisyysqgcCdecO57Dj79RfL0LNeGiFUqLYQRYLE= github.com/containerd/cgroups v1.0.1/go.mod h1:0SJrPIenamHDcZhEcJMNBB85rHcUsw4f25ZfBiPYRkU= github.com/containerd/cgroups v1.0.3/go.mod h1:/ofk34relqNjSGyqPrmEULrO4Sc8LJhvJmWbUCUKqj8= -github.com/containerd/cgroups v1.0.4/go.mod h1:nLNQtsF7Sl2HxNebu77i1R0oDlhiTG+kO4JTrUzo6IA= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= +github.com/containerd/cgroups/v3 v3.0.1/go.mod h1:/vtwk1VXrtoa5AaZLkypuOJgA/6DyPMZHJPGQNtlHnw= github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0= github.com/containerd/cgroups/v3 v3.0.2/go.mod h1:JUgITrzdFqp42uI2ryGA+ge0ap/nxzYgkGmIcetmErE= github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= @@ -1402,9 +1405,8 @@ github.com/containerd/containerd v1.6.1/go.mod h1:1nJz5xCZPusx6jJU8Frfct988y0Npu github.com/containerd/containerd v1.6.6/go.mod h1:ZoP1geJldzCVY3Tonoz7b1IXk8rIX0Nltt5QE4OMNk0= github.com/containerd/containerd v1.6.8/go.mod h1:By6p5KqPK0/7/CgO/A6t/Gz+CUYUu2zf1hUaaymVXB0= github.com/containerd/containerd v1.6.9/go.mod h1:XVicUvkxOrftE2Q1YWUXgZwkkAxwQYNOFzYWvfVfEfQ= -github.com/containerd/containerd v1.6.18/go.mod h1:1RdCUu95+gc2v9t3IL+zIlpClSmew7/0YS8O5eQZrOw= -github.com/containerd/containerd v1.7.3 h1:cKwYKkP1eTj54bP3wCdXXBymmKRQMrWjkLSWZZJDa8o= -github.com/containerd/containerd v1.7.3/go.mod h1:32FOM4/O0RkNg7AjQj3hDzN9cUGtu+HMvaKUNiqCZB8= +github.com/containerd/containerd v1.7.0 h1:G/ZQr3gMZs6ZT0qPUZ15znx5QSdQdASW11nXTLTM2Pg= +github.com/containerd/containerd v1.7.0/go.mod h1:QfR7Efgb/6X2BDpTPJRvPTYDE9rsF0FsXX9J8sIs/sc= github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20191127005431-f65d91d395eb/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y= github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo= @@ -1413,8 +1415,8 @@ github.com/containerd/continuity v0.0.0-20210208174643-50096c924a4e/go.mod h1:EX github.com/containerd/continuity v0.1.0/go.mod h1:ICJu0PwR54nI0yPEnJ6jcS+J7CZAUXrLh8lPo2knzsM= github.com/containerd/continuity v0.2.2/go.mod h1:pWygW9u7LtS1o4N/Tn0FoCFDIXZ7rxcMX7HX1Dmibvk= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= -github.com/containerd/continuity v0.4.1 h1:wQnVrjIyQ8vhU2sgOiL5T07jo+ouqc2bnKsv5/EqGhU= -github.com/containerd/continuity v0.4.1/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= +github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= +github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= @@ -1457,19 +1459,20 @@ github.com/containerd/ttrpc v1.0.1/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8h github.com/containerd/ttrpc v1.0.2/go.mod h1:UAxOpgT9ziI0gJrmKvgcZivgxOp8iFPSk8httJEt98Y= github.com/containerd/ttrpc v1.1.0/go.mod h1:XX4ZTnoOId4HklF4edwc4DcqskFZuvXB1Evzy5KFQpQ= github.com/containerd/ttrpc v1.1.1-0.20220420014843-944ef4a40df3/go.mod h1:YYyNVhZrTMiaf51Vj6WhAJqJw+vl/nzABhj8pWrzle4= +github.com/containerd/ttrpc v1.2.1/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= github.com/containerd/ttrpc v1.2.2 h1:9vqZr0pxwOF5koz6N0N3kJ0zDHokrcPxIR/ZR2YFtOs= github.com/containerd/ttrpc v1.2.2/go.mod h1:sIT6l32Ph/H9cvnJsfXM5drIVzTr5A2flTf1G5tYZak= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/containerd/typeurl v0.0.0-20190911142611-5eb25027c9fd/go.mod h1:GeKYzf2pQcqv7tJ0AoCuuhtnqhva5LNU3U+OyKxxJpk= github.com/containerd/typeurl v1.0.1/go.mod h1:TB1hUtrpaiO88KEK56ijojHS1+NeF0izUACaJW2mdXg= github.com/containerd/typeurl v1.0.2/go.mod h1:9trJWW2sRlGub4wZJRTW83VtbOLS6hwcDZXTn6oPz9s= +github.com/containerd/typeurl/v2 v2.1.0/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= github.com/containerd/typeurl/v2 v2.1.1 h1:3Q4Pt7i8nYwy2KmQWIw2+1hTvwTE/6w9FqcttATPO/4= github.com/containerd/typeurl/v2 v2.1.1/go.mod h1:IDp2JFvbwZ31H8dQbEIY7sDl2L3o3HZj1hsSQlywkQ0= github.com/containerd/zfs v0.0.0-20200918131355-0a33824f23a2/go.mod h1:8IgZOBdv8fAgXddBT4dBXJPtxyRsejFIpXoklgxgEjw= github.com/containerd/zfs v0.0.0-20210301145711-11e8f1707f62/go.mod h1:A9zfAbMlQwE+/is6hi0Xw8ktpL+6glmqZYtevJgaB8Y= github.com/containerd/zfs v0.0.0-20210324211415-d5c4544f0433/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= github.com/containerd/zfs v1.0.0/go.mod h1:m+m51S1DvAP6r3FcmYCp54bQ34pyOwTieQDNRIRHsFY= -github.com/containerd/zfs v1.1.0/go.mod h1:oZF9wBnrnQjpWLaPKEinrx3TQ9a+W/RJO7Zb41d8YLE= github.com/containernetworking/cni v0.7.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.0/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= github.com/containernetworking/cni v0.8.1/go.mod h1:LGwApLUm2FpoOfxTDEeq8T9ipbpZ61X79hmU3w8FmsY= @@ -1518,7 +1521,6 @@ github.com/creack/pty v1.1.11/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/d2g/dhcp4 v0.0.0-20170904100407-a1d1b6c41b1c/go.mod h1:Ct2BUK8SB0YC1SMSibvLzxjeJLnrYEVLULFNiHY9YfQ= github.com/d2g/dhcp4client v1.0.0/go.mod h1:j0hNfjhrt2SxUOw55nL0ATM/z4Yt3t2Kd1mW34z5W5s= @@ -2029,7 +2031,6 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/sha256-simd v1.0.0/go.mod h1:OuYzVNI5vcoYIAmbIvHPl3N3jUzVedXbKy5RFepssQM= github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible/go.mod h1:8AuVvqP/mXw1px98n46wfvcGfQ4ci2FwoAjKYxuo3Z4= -github.com/mistifyio/go-zfs/v3 v3.0.1/go.mod h1:CzVgeB0RvF2EGzQnytKVvVSDwmKJXxkOTUGbNrTja/k= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -2128,7 +2129,6 @@ github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zM github.com/opencontainers/image-spec v1.0.2-0.20211117181255-693428a734f5/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.2/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= github.com/opencontainers/image-spec v1.0.3-0.20211202183452-c5a74bcca799/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/image-spec v1.1.0-rc3 h1:fzg1mXZFj8YdPeNkRXMg+zb88BFV0Ys52cJydRwBkb8= github.com/opencontainers/image-spec v1.1.0-rc3/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= @@ -2139,7 +2139,7 @@ github.com/opencontainers/runc v1.0.0-rc93/go.mod h1:3NOsor4w32B2tC0Zbl8Knk4Wg84 github.com/opencontainers/runc v1.0.2/go.mod h1:aTaHFFwQXuA71CiyxOdFFIorAoemI04suvGRQFzWTD0= github.com/opencontainers/runc v1.1.0/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= github.com/opencontainers/runc v1.1.2/go.mod h1:Tj1hFw6eFWp/o33uxGf5yF2BX5yz2Z6iptFpuvbbKqc= -github.com/opencontainers/runc v1.1.5/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= +github.com/opencontainers/runc v1.1.4/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= github.com/opencontainers/runtime-spec v1.0.1/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -3057,6 +3057,7 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= +golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= @@ -3495,9 +3496,8 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk= +gotest.tools/v3 v3.0.3 h1:4AuOwCGf4lLR9u3YOe2awrHygurzhO/HeQ6laiA6Sx0= gotest.tools/v3 v3.0.3/go.mod h1:Z7Lb0S5l+klDB31fvDQX8ss/FlKDxtlFlw3Oa8Ymbl8= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= -gotest.tools/v3 v3.4.0/go.mod h1:CtbdzLSsqVhDgMtKsx03ird5YTGB3ar27v0u/yKBW5g= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -3540,8 +3540,8 @@ k8s.io/cri-api v0.20.6/go.mod h1:ew44AjNXwyn1s0U4xCKGodU7J1HzBeZ1MpGrpa5r8Yc= k8s.io/cri-api v0.23.1/go.mod h1:REJE3PSU0h/LOV1APBrupxrEJqnoxZC8KWzkBUHwrK4= k8s.io/cri-api v0.25.0/go.mod h1:J1rAyQkSJ2Q6I+aBMOVgg2/cbbebso6FNa0UagiR0kc= k8s.io/cri-api v0.25.3/go.mod h1:riC/P0yOGUf2K1735wW+CXs1aY2ctBgePtnnoFLd0dU= -k8s.io/cri-api v0.27.1 h1:KWO+U8MfI9drXB/P4oU9VchaWYOlwDglJZVHWMpTT3Q= -k8s.io/cri-api v0.27.1/go.mod h1:+Ts/AVYbIo04S86XbTD73UPp/DkTiYxtsFeOFEu32L0= +k8s.io/cri-api v0.26.2 h1:Vifw8T4ZFzU5pQ5dj5rdDsPOSzmLAvhVcYEJpbjOYLY= +k8s.io/cri-api v0.26.2/go.mod h1:Oo8O7MKFPNDxfDf2LmrF/3Hf30q1C6iliGuv3la3tIA= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= diff --git a/vendor/github.com/Microsoft/go-winio/pkg/bindfilter/bind_filter.go b/vendor/github.com/Microsoft/go-winio/pkg/bindfilter/bind_filter.go deleted file mode 100644 index 7ac377ae46..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/bindfilter/bind_filter.go +++ /dev/null @@ -1,308 +0,0 @@ -//go:build windows -// +build windows - -package bindfilter - -import ( - "bytes" - "encoding/binary" - "errors" - "fmt" - "os" - "path/filepath" - "strings" - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -//go:generate go run github.com/Microsoft/go-winio/tools/mkwinsyscall -output zsyscall_windows.go ./bind_filter.go -//sys bfSetupFilter(jobHandle windows.Handle, flags uint32, virtRootPath string, virtTargetPath string, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) = bindfltapi.BfSetupFilter? -//sys bfRemoveMapping(jobHandle windows.Handle, virtRootPath string) (hr error) = bindfltapi.BfRemoveMapping? -//sys bfGetMappings(flags uint32, jobHandle windows.Handle, virtRootPath *uint16, sid *windows.SID, bufferSize *uint32, outBuffer *byte) (hr error) = bindfltapi.BfGetMappings? - -// BfSetupFilter flags. See: -// https://github.com/microsoft/BuildXL/blob/a6dce509f0d4f774255e5fbfb75fa6d5290ed163/Public/Src/Utilities/Native/Processes/Windows/NativeContainerUtilities.cs#L193-L240 -// -//nolint:revive // var-naming: ALL_CAPS -const ( - BINDFLT_FLAG_READ_ONLY_MAPPING uint32 = 0x00000001 - // Tells bindflt to fail mapping with STATUS_INVALID_PARAMETER if a mapping produces - // multiple targets. - BINDFLT_FLAG_NO_MULTIPLE_TARGETS uint32 = 0x00000040 -) - -//nolint:revive // var-naming: ALL_CAPS -const ( - BINDFLT_GET_MAPPINGS_FLAG_VOLUME uint32 = 0x00000001 - BINDFLT_GET_MAPPINGS_FLAG_SILO uint32 = 0x00000002 - BINDFLT_GET_MAPPINGS_FLAG_USER uint32 = 0x00000004 -) - -// ApplyFileBinding creates a global mount of the source in root, with an optional -// read only flag. -// The bind filter allows us to create mounts of directories and volumes. By default it allows -// us to mount multiple sources inside a single root, acting as an overlay. Files from the -// second source will superscede the first source that was mounted. -// This function disables this behavior and sets the BINDFLT_FLAG_NO_MULTIPLE_TARGETS flag -// on the mount. -func ApplyFileBinding(root, source string, readOnly bool) error { - // The parent directory needs to exist for the bind to work. MkdirAll stats and - // returns nil if the directory exists internally so we should be fine to mkdirall - // every time. - if err := os.MkdirAll(filepath.Dir(root), 0); err != nil { - return err - } - - if strings.Contains(source, "Volume{") && !strings.HasSuffix(source, "\\") { - // Add trailing slash to volumes, otherwise we get an error when binding it to - // a folder. - source = source + "\\" - } - - flags := BINDFLT_FLAG_NO_MULTIPLE_TARGETS - if readOnly { - flags |= BINDFLT_FLAG_READ_ONLY_MAPPING - } - - // Set the job handle to 0 to create a global mount. - if err := bfSetupFilter( - 0, - flags, - root, - source, - nil, - 0, - ); err != nil { - return fmt.Errorf("failed to bind target %q to root %q: %w", source, root, err) - } - return nil -} - -// RemoveFileBinding removes a mount from the root path. -func RemoveFileBinding(root string) error { - if err := bfRemoveMapping(0, root); err != nil { - return fmt.Errorf("removing file binding: %w", err) - } - return nil -} - -// GetBindMappings returns a list of bind mappings that have their root on a -// particular volume. The volumePath parameter can be any path that exists on -// a volume. For example, if a number of mappings are created in C:\ProgramData\test, -// to get a list of those mappings, the volumePath parameter would have to be set to -// C:\ or the VOLUME_NAME_GUID notation of C:\ (\\?\Volume{GUID}\), or any child -// path that exists. -func GetBindMappings(volumePath string) ([]BindMapping, error) { - rootPtr, err := windows.UTF16PtrFromString(volumePath) - if err != nil { - return nil, err - } - - flags := BINDFLT_GET_MAPPINGS_FLAG_VOLUME - // allocate a large buffer for results - var outBuffSize uint32 = 256 * 1024 - buf := make([]byte, outBuffSize) - - if err := bfGetMappings(flags, 0, rootPtr, nil, &outBuffSize, &buf[0]); err != nil { - return nil, err - } - - if outBuffSize < 12 { - return nil, fmt.Errorf("invalid buffer returned") - } - - result := buf[:outBuffSize] - - // The first 12 bytes are the three uint32 fields in getMappingsResponseHeader{} - headerBuffer := result[:12] - // The alternative to using unsafe and casting it to the above defined structures, is to manually - // parse the fields. Not too terrible, but not sure it'd worth the trouble. - header := *(*getMappingsResponseHeader)(unsafe.Pointer(&headerBuffer[0])) - - if header.MappingCount == 0 { - // no mappings - return []BindMapping{}, nil - } - - mappingsBuffer := result[12 : int(unsafe.Sizeof(mappingEntry{}))*int(header.MappingCount)] - // Get a pointer to the first mapping in the slice - mappingsPointer := (*mappingEntry)(unsafe.Pointer(&mappingsBuffer[0])) - // Get slice of mappings - mappings := unsafe.Slice(mappingsPointer, header.MappingCount) - - mappingEntries := make([]BindMapping, header.MappingCount) - for i := 0; i < int(header.MappingCount); i++ { - bindMapping, err := getBindMappingFromBuffer(result, mappings[i]) - if err != nil { - return nil, fmt.Errorf("fetching bind mappings: %w", err) - } - mappingEntries[i] = bindMapping - } - - return mappingEntries, nil -} - -// mappingEntry holds information about where in the response buffer we can -// find information about the virtual root (the mount point) and the targets (sources) -// that get mounted, as well as the flags used to bind the targets to the virtual root. -type mappingEntry struct { - VirtRootLength uint32 - VirtRootOffset uint32 - Flags uint32 - NumberOfTargets uint32 - TargetEntriesOffset uint32 -} - -type mappingTargetEntry struct { - TargetRootLength uint32 - TargetRootOffset uint32 -} - -// getMappingsResponseHeader represents the first 12 bytes of the BfGetMappings() response. -// It gives us the size of the buffer, the status of the call and the number of mappings. -// A response -type getMappingsResponseHeader struct { - Size uint32 - Status uint32 - MappingCount uint32 -} - -type BindMapping struct { - MountPoint string - Flags uint32 - Targets []string -} - -func decodeEntry(buffer []byte) (string, error) { - name := make([]uint16, len(buffer)/2) - err := binary.Read(bytes.NewReader(buffer), binary.LittleEndian, &name) - if err != nil { - return "", fmt.Errorf("decoding name: %w", err) - } - return windows.UTF16ToString(name), nil -} - -func getTargetsFromBuffer(buffer []byte, offset, count int) ([]string, error) { - if len(buffer) < offset+count*6 { - return nil, fmt.Errorf("invalid buffer") - } - - targets := make([]string, count) - for i := 0; i < count; i++ { - entryBuf := buffer[offset+i*8 : offset+i*8+8] - tgt := *(*mappingTargetEntry)(unsafe.Pointer(&entryBuf[0])) - if len(buffer) < int(tgt.TargetRootOffset)+int(tgt.TargetRootLength) { - return nil, fmt.Errorf("invalid buffer") - } - decoded, err := decodeEntry(buffer[tgt.TargetRootOffset : tgt.TargetRootOffset+tgt.TargetRootLength]) - if err != nil { - return nil, fmt.Errorf("decoding name: %w", err) - } - decoded, err = getFinalPath(decoded) - if err != nil { - return nil, fmt.Errorf("fetching final path: %w", err) - } - - targets[i] = decoded - } - return targets, nil -} - -func getFinalPath(pth string) (string, error) { - // BfGetMappings returns VOLUME_NAME_NT paths like \Device\HarddiskVolume2\ProgramData. - // These can be accessed by prepending \\.\GLOBALROOT to the path. We use this to get the - // DOS paths for these files. - if strings.HasPrefix(pth, `\Device`) { - pth = `\\.\GLOBALROOT` + pth - } - - han, err := openPath(pth) - if err != nil { - return "", fmt.Errorf("fetching file handle: %w", err) - } - defer func() { - _ = windows.CloseHandle(han) - }() - - buf := make([]uint16, 100) - var flags uint32 = 0x0 - for { - n, err := windows.GetFinalPathNameByHandle(han, &buf[0], uint32(len(buf)), flags) - if err != nil { - // if we mounted a volume that does not also have a drive letter assigned, attempting to - // fetch the VOLUME_NAME_DOS will fail with os.ErrNotExist. Attempt to get the VOLUME_NAME_GUID. - if errors.Is(err, os.ErrNotExist) && flags != 0x1 { - flags = 0x1 - continue - } - return "", fmt.Errorf("getting final path name: %w", err) - } - if n < uint32(len(buf)) { - break - } - buf = make([]uint16, n) - } - finalPath := syscall.UTF16ToString(buf) - // We got VOLUME_NAME_DOS, we need to strip away some leading slashes. - // Leave unchanged if we ended up requesting VOLUME_NAME_GUID - if len(finalPath) > 4 && finalPath[:4] == `\\?\` && flags == 0x0 { - finalPath = finalPath[4:] - if len(finalPath) > 3 && finalPath[:3] == `UNC` { - // return path like \\server\share\... - finalPath = `\` + finalPath[3:] - } - } - - return finalPath, nil -} - -func getBindMappingFromBuffer(buffer []byte, entry mappingEntry) (BindMapping, error) { - if len(buffer) < int(entry.VirtRootOffset)+int(entry.VirtRootLength) { - return BindMapping{}, fmt.Errorf("invalid buffer") - } - - src, err := decodeEntry(buffer[entry.VirtRootOffset : entry.VirtRootOffset+entry.VirtRootLength]) - if err != nil { - return BindMapping{}, fmt.Errorf("decoding entry: %w", err) - } - targets, err := getTargetsFromBuffer(buffer, int(entry.TargetEntriesOffset), int(entry.NumberOfTargets)) - if err != nil { - return BindMapping{}, fmt.Errorf("fetching targets: %w", err) - } - - src, err = getFinalPath(src) - if err != nil { - return BindMapping{}, fmt.Errorf("fetching final path: %w", err) - } - - return BindMapping{ - Flags: entry.Flags, - Targets: targets, - MountPoint: src, - }, nil -} - -func openPath(path string) (windows.Handle, error) { - u16, err := windows.UTF16PtrFromString(path) - if err != nil { - return 0, err - } - h, err := windows.CreateFile( - u16, - 0, - windows.FILE_SHARE_READ|windows.FILE_SHARE_WRITE|windows.FILE_SHARE_DELETE, - nil, - windows.OPEN_EXISTING, - windows.FILE_FLAG_BACKUP_SEMANTICS, // Needed to open a directory handle. - 0) - if err != nil { - return 0, &os.PathError{ - Op: "CreateFile", - Path: path, - Err: err, - } - } - return h, nil -} diff --git a/vendor/github.com/Microsoft/go-winio/pkg/bindfilter/zsyscall_windows.go b/vendor/github.com/Microsoft/go-winio/pkg/bindfilter/zsyscall_windows.go deleted file mode 100644 index 45c45c96e4..0000000000 --- a/vendor/github.com/Microsoft/go-winio/pkg/bindfilter/zsyscall_windows.go +++ /dev/null @@ -1,116 +0,0 @@ -//go:build windows - -// Code generated by 'go generate' using "github.com/Microsoft/go-winio/tools/mkwinsyscall"; DO NOT EDIT. - -package bindfilter - -import ( - "syscall" - "unsafe" - - "golang.org/x/sys/windows" -) - -var _ unsafe.Pointer - -// Do the interface allocations only once for common -// Errno values. -const ( - errnoERROR_IO_PENDING = 997 -) - -var ( - errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) - errERROR_EINVAL error = syscall.EINVAL -) - -// errnoErr returns common boxed Errno values, to prevent -// allocations at runtime. -func errnoErr(e syscall.Errno) error { - switch e { - case 0: - return errERROR_EINVAL - case errnoERROR_IO_PENDING: - return errERROR_IO_PENDING - } - // TODO: add more here, after collecting data on the common - // error values see on Windows. (perhaps when running - // all.bat?) - return e -} - -var ( - modbindfltapi = windows.NewLazySystemDLL("bindfltapi.dll") - - procBfGetMappings = modbindfltapi.NewProc("BfGetMappings") - procBfRemoveMapping = modbindfltapi.NewProc("BfRemoveMapping") - procBfSetupFilter = modbindfltapi.NewProc("BfSetupFilter") -) - -func bfGetMappings(flags uint32, jobHandle windows.Handle, virtRootPath *uint16, sid *windows.SID, bufferSize *uint32, outBuffer *byte) (hr error) { - hr = procBfGetMappings.Find() - if hr != nil { - return - } - r0, _, _ := syscall.Syscall6(procBfGetMappings.Addr(), 6, uintptr(flags), uintptr(jobHandle), uintptr(unsafe.Pointer(virtRootPath)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(bufferSize)), uintptr(unsafe.Pointer(outBuffer))) - if int32(r0) < 0 { - if r0&0x1fff0000 == 0x00070000 { - r0 &= 0xffff - } - hr = syscall.Errno(r0) - } - return -} - -func bfRemoveMapping(jobHandle windows.Handle, virtRootPath string) (hr error) { - var _p0 *uint16 - _p0, hr = syscall.UTF16PtrFromString(virtRootPath) - if hr != nil { - return - } - return _bfRemoveMapping(jobHandle, _p0) -} - -func _bfRemoveMapping(jobHandle windows.Handle, virtRootPath *uint16) (hr error) { - hr = procBfRemoveMapping.Find() - if hr != nil { - return - } - r0, _, _ := syscall.Syscall(procBfRemoveMapping.Addr(), 2, uintptr(jobHandle), uintptr(unsafe.Pointer(virtRootPath)), 0) - if int32(r0) < 0 { - if r0&0x1fff0000 == 0x00070000 { - r0 &= 0xffff - } - hr = syscall.Errno(r0) - } - return -} - -func bfSetupFilter(jobHandle windows.Handle, flags uint32, virtRootPath string, virtTargetPath string, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) { - var _p0 *uint16 - _p0, hr = syscall.UTF16PtrFromString(virtRootPath) - if hr != nil { - return - } - var _p1 *uint16 - _p1, hr = syscall.UTF16PtrFromString(virtTargetPath) - if hr != nil { - return - } - return _bfSetupFilter(jobHandle, flags, _p0, _p1, virtExceptions, virtExceptionPathCount) -} - -func _bfSetupFilter(jobHandle windows.Handle, flags uint32, virtRootPath *uint16, virtTargetPath *uint16, virtExceptions **uint16, virtExceptionPathCount uint32) (hr error) { - hr = procBfSetupFilter.Find() - if hr != nil { - return - } - r0, _, _ := syscall.Syscall6(procBfSetupFilter.Addr(), 6, uintptr(jobHandle), uintptr(flags), uintptr(unsafe.Pointer(virtRootPath)), uintptr(unsafe.Pointer(virtTargetPath)), uintptr(unsafe.Pointer(virtExceptions)), uintptr(virtExceptionPathCount)) - if int32(r0) < 0 { - if r0&0x1fff0000 == 0x00070000 { - r0 &= 0xffff - } - hr = syscall.Errno(r0) - } - return -} diff --git a/vendor/github.com/containerd/containerd/api/events/sandbox.pb.go b/vendor/github.com/containerd/containerd/api/events/sandbox.pb.go deleted file mode 100644 index 08f5e70e48..0000000000 --- a/vendor/github.com/containerd/containerd/api/events/sandbox.pb.go +++ /dev/null @@ -1,316 +0,0 @@ -// -//Copyright The containerd Authors. -// -//Licensed under the Apache License, Version 2.0 (the "License"); -//you may not use this file except in compliance with the License. -//You may obtain a copy of the License at -// -//http://www.apache.org/licenses/LICENSE-2.0 -// -//Unless required by applicable law or agreed to in writing, software -//distributed under the License is distributed on an "AS IS" BASIS, -//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -//See the License for the specific language governing permissions and -//limitations under the License. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: github.com/containerd/containerd/api/events/sandbox.proto - -package events - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type SandboxCreate struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *SandboxCreate) Reset() { - *x = SandboxCreate{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxCreate) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxCreate) ProtoMessage() {} - -func (x *SandboxCreate) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SandboxCreate.ProtoReflect.Descriptor instead. -func (*SandboxCreate) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescGZIP(), []int{0} -} - -func (x *SandboxCreate) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type SandboxStart struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` -} - -func (x *SandboxStart) Reset() { - *x = SandboxStart{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxStart) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxStart) ProtoMessage() {} - -func (x *SandboxStart) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SandboxStart.ProtoReflect.Descriptor instead. -func (*SandboxStart) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescGZIP(), []int{1} -} - -func (x *SandboxStart) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -type SandboxExit struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - SandboxID string `protobuf:"bytes,1,opt,name=sandbox_id,json=sandboxId,proto3" json:"sandbox_id,omitempty"` - ExitStatus uint32 `protobuf:"varint,2,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` - ExitedAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=exited_at,json=exitedAt,proto3" json:"exited_at,omitempty"` -} - -func (x *SandboxExit) Reset() { - *x = SandboxExit{} - if protoimpl.UnsafeEnabled { - mi := &file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SandboxExit) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SandboxExit) ProtoMessage() {} - -func (x *SandboxExit) ProtoReflect() protoreflect.Message { - mi := &file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SandboxExit.ProtoReflect.Descriptor instead. -func (*SandboxExit) Descriptor() ([]byte, []int) { - return file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescGZIP(), []int{2} -} - -func (x *SandboxExit) GetSandboxID() string { - if x != nil { - return x.SandboxID - } - return "" -} - -func (x *SandboxExit) GetExitStatus() uint32 { - if x != nil { - return x.ExitStatus - } - return 0 -} - -func (x *SandboxExit) GetExitedAt() *timestamppb.Timestamp { - if x != nil { - return x.ExitedAt - } - return nil -} - -var File_github_com_containerd_containerd_api_events_sandbox_proto protoreflect.FileDescriptor - -var file_github_com_containerd_containerd_api_events_sandbox_proto_rawDesc = []byte{ - 0x0a, 0x39, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x61, - 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x11, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x1f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x2e, 0x0a, 0x0d, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, - 0x2d, 0x0a, 0x0c, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x53, 0x74, 0x61, 0x72, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x22, 0x86, - 0x01, 0x0a, 0x0b, 0x53, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x45, 0x78, 0x69, 0x74, 0x12, 0x1d, - 0x0a, 0x0a, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x73, 0x61, 0x6e, 0x64, 0x62, 0x6f, 0x78, 0x49, 0x64, 0x12, 0x1f, 0x0a, - 0x0b, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x78, 0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x37, - 0x0a, 0x09, 0x65, 0x78, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x08, 0x65, - 0x78, 0x69, 0x74, 0x65, 0x64, 0x41, 0x74, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, - 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, - 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescOnce sync.Once - file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescData = file_github_com_containerd_containerd_api_events_sandbox_proto_rawDesc -) - -func file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescGZIP() []byte { - file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescOnce.Do(func() { - file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescData = protoimpl.X.CompressGZIP(file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescData) - }) - return file_github_com_containerd_containerd_api_events_sandbox_proto_rawDescData -} - -var file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_github_com_containerd_containerd_api_events_sandbox_proto_goTypes = []interface{}{ - (*SandboxCreate)(nil), // 0: containerd.events.SandboxCreate - (*SandboxStart)(nil), // 1: containerd.events.SandboxStart - (*SandboxExit)(nil), // 2: containerd.events.SandboxExit - (*timestamppb.Timestamp)(nil), // 3: google.protobuf.Timestamp -} -var file_github_com_containerd_containerd_api_events_sandbox_proto_depIdxs = []int32{ - 3, // 0: containerd.events.SandboxExit.exited_at:type_name -> google.protobuf.Timestamp - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_github_com_containerd_containerd_api_events_sandbox_proto_init() } -func file_github_com_containerd_containerd_api_events_sandbox_proto_init() { - if File_github_com_containerd_containerd_api_events_sandbox_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxCreate); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxStart); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SandboxExit); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_github_com_containerd_containerd_api_events_sandbox_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_github_com_containerd_containerd_api_events_sandbox_proto_goTypes, - DependencyIndexes: file_github_com_containerd_containerd_api_events_sandbox_proto_depIdxs, - MessageInfos: file_github_com_containerd_containerd_api_events_sandbox_proto_msgTypes, - }.Build() - File_github_com_containerd_containerd_api_events_sandbox_proto = out.File - file_github_com_containerd_containerd_api_events_sandbox_proto_rawDesc = nil - file_github_com_containerd_containerd_api_events_sandbox_proto_goTypes = nil - file_github_com_containerd_containerd_api_events_sandbox_proto_depIdxs = nil -} diff --git a/vendor/github.com/containerd/containerd/api/events/sandbox.proto b/vendor/github.com/containerd/containerd/api/events/sandbox.proto deleted file mode 100644 index f1c5195e5a..0000000000 --- a/vendor/github.com/containerd/containerd/api/events/sandbox.proto +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -syntax = "proto3"; - -package containerd.events; - -import "google/protobuf/timestamp.proto"; - -option go_package = "github.com/containerd/containerd/api/events;events"; - -message SandboxCreate { - string sandbox_id = 1; -} - -message SandboxStart { - string sandbox_id = 1; -} - -message SandboxExit { - string sandbox_id = 1; - uint32 exit_status = 2; - google.protobuf.Timestamp exited_at = 3; -} diff --git a/vendor/github.com/containerd/containerd/api/events/sandbox_fieldpath.pb.go b/vendor/github.com/containerd/containerd/api/events/sandbox_fieldpath.pb.go deleted file mode 100644 index 5afb99457a..0000000000 --- a/vendor/github.com/containerd/containerd/api/events/sandbox_fieldpath.pb.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by protoc-gen-go-fieldpath. DO NOT EDIT. -// source: github.com/containerd/containerd/api/events/sandbox.proto -package events - -// Field returns the value for the given fieldpath as a string, if defined. -// If the value is not defined, the second value will be false. -func (m *SandboxCreate) Field(fieldpath []string) (string, bool) { - if len(fieldpath) == 0 { - return "", false - } - switch fieldpath[0] { - case "sandbox_id": - return string(m.SandboxID), len(m.SandboxID) > 0 - } - return "", false -} - -// Field returns the value for the given fieldpath as a string, if defined. -// If the value is not defined, the second value will be false. -func (m *SandboxStart) Field(fieldpath []string) (string, bool) { - if len(fieldpath) == 0 { - return "", false - } - switch fieldpath[0] { - case "sandbox_id": - return string(m.SandboxID), len(m.SandboxID) > 0 - } - return "", false -} - -// Field returns the value for the given fieldpath as a string, if defined. -// If the value is not defined, the second value will be false. -func (m *SandboxExit) Field(fieldpath []string) (string, bool) { - if len(fieldpath) == 0 { - return "", false - } - switch fieldpath[0] { - // unhandled: exit_status - // unhandled: exited_at - case "sandbox_id": - return string(m.SandboxID), len(m.SandboxID) > 0 - } - return "", false -} diff --git a/vendor/github.com/containerd/containerd/log/context.go b/vendor/github.com/containerd/containerd/log/context.go index b63c602f42..92cfcd91ae 100644 --- a/vendor/github.com/containerd/containerd/log/context.go +++ b/vendor/github.com/containerd/containerd/log/context.go @@ -18,7 +18,6 @@ package log import ( "context" - "fmt" "github.com/sirupsen/logrus" ) @@ -39,9 +38,6 @@ type ( // Fields type to pass to `WithFields`, alias from `logrus`. Fields = logrus.Fields - - // Level is a logging level - Level = logrus.Level ) const ( @@ -54,52 +50,8 @@ const ( // JSONFormat represents the JSON logging format JSONFormat = "json" - - // TraceLevel level. - TraceLevel = logrus.TraceLevel - - // DebugLevel level. - DebugLevel = logrus.DebugLevel - - // InfoLevel level. - InfoLevel = logrus.InfoLevel ) -// SetLevel sets log level globally. -func SetLevel(level string) error { - lvl, err := logrus.ParseLevel(level) - if err != nil { - return err - } - - logrus.SetLevel(lvl) - return nil -} - -// GetLevel returns the current log level. -func GetLevel() Level { - return logrus.GetLevel() -} - -// SetFormat sets log output format -func SetFormat(format string) error { - switch format { - case TextFormat: - logrus.SetFormatter(&logrus.TextFormatter{ - TimestampFormat: RFC3339NanoFixed, - FullTimestamp: true, - }) - case JSONFormat: - logrus.SetFormatter(&logrus.JSONFormatter{ - TimestampFormat: RFC3339NanoFixed, - }) - default: - return fmt.Errorf("unknown log format: %s", format) - } - - return nil -} - // WithLogger returns a new context with the provided logger. Use in // combination with logger.WithField(s) for great effect. func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context { diff --git a/vendor/github.com/containerd/containerd/mount/mount.go b/vendor/github.com/containerd/containerd/mount/mount.go index ae7520f980..21dd0f9037 100644 --- a/vendor/github.com/containerd/containerd/mount/mount.go +++ b/vendor/github.com/containerd/containerd/mount/mount.go @@ -18,7 +18,6 @@ package mount import ( "fmt" - "strings" "github.com/containerd/continuity/fs" ) @@ -68,17 +67,6 @@ func UnmountMounts(mounts []Mount, target string, flags int) error { return nil } -// ReadOnly returns a boolean value indicating whether this mount has the "ro" -// option set. -func (m *Mount) ReadOnly() bool { - for _, option := range m.Options { - if option == "ro" { - return true - } - } - return false -} - // Mount to the provided target path. func (m *Mount) Mount(target string) error { target, err := fs.RootPath(target, m.Target) @@ -87,46 +75,3 @@ func (m *Mount) Mount(target string) error { } return m.mount(target) } - -// readonlyMounts modifies the received mount options -// to make them readonly -func readonlyMounts(mounts []Mount) []Mount { - for i, m := range mounts { - if m.Type == "overlay" { - mounts[i].Options = readonlyOverlay(m.Options) - continue - } - opts := make([]string, 0, len(m.Options)) - for _, opt := range m.Options { - if opt != "rw" && opt != "ro" { // skip `ro` too so we don't append it twice - opts = append(opts, opt) - } - } - opts = append(opts, "ro") - mounts[i].Options = opts - } - return mounts -} - -// readonlyOverlay takes mount options for overlay mounts and makes them readonly by -// removing workdir and upperdir (and appending the upperdir layer to lowerdir) - see: -// https://www.kernel.org/doc/html/latest/filesystems/overlayfs.html#multiple-lower-layers -func readonlyOverlay(opt []string) []string { - out := make([]string, 0, len(opt)) - upper := "" - for _, o := range opt { - if strings.HasPrefix(o, "upperdir=") { - upper = strings.TrimPrefix(o, "upperdir=") - } else if !strings.HasPrefix(o, "workdir=") { - out = append(out, o) - } - } - if upper != "" { - for i, o := range out { - if strings.HasPrefix(o, "lowerdir=") { - out[i] = "lowerdir=" + upper + ":" + strings.TrimPrefix(o, "lowerdir=") - } - } - } - return out -} diff --git a/vendor/github.com/containerd/containerd/mount/mount_windows.go b/vendor/github.com/containerd/containerd/mount/mount_windows.go index 7c24fa600c..b73fe3646f 100644 --- a/vendor/github.com/containerd/containerd/mount/mount_windows.go +++ b/vendor/github.com/containerd/containerd/mount/mount_windows.go @@ -17,29 +17,17 @@ package mount import ( - "context" "encoding/json" - "errors" "fmt" "os" "path/filepath" "strings" - "github.com/Microsoft/go-winio/pkg/bindfilter" "github.com/Microsoft/hcsshim" - "github.com/containerd/containerd/log" - "golang.org/x/sys/windows" -) - -const sourceStreamName = "containerd.io-source" - -var ( - // ErrNotImplementOnWindows is returned when an action is not implemented for windows - ErrNotImplementOnWindows = errors.New("not implemented under windows") ) // Mount to the provided target. -func (m *Mount) mount(target string) (retErr error) { +func (m *Mount) mount(target string) error { if m.Type != "windows-layer" { return fmt.Errorf("invalid windows mount type: '%s'", m.Type) } @@ -55,60 +43,25 @@ func (m *Mount) mount(target string) (retErr error) { HomeDir: home, } - if err := hcsshim.ActivateLayer(di, layerID); err != nil { + if err = hcsshim.ActivateLayer(di, layerID); err != nil { return fmt.Errorf("failed to activate layer %s: %w", m.Source, err) } - defer func() { - if retErr != nil { - if layerErr := hcsshim.DeactivateLayer(di, layerID); layerErr != nil { - log.G(context.TODO()).WithError(layerErr).Error("failed to deactivate layer during mount failure cleanup") - } - } - }() - if err := hcsshim.PrepareLayer(di, layerID, parentLayerPaths); err != nil { + if err = hcsshim.PrepareLayer(di, layerID, parentLayerPaths); err != nil { return fmt.Errorf("failed to prepare layer %s: %w", m.Source, err) } - defer func() { - if retErr != nil { - if layerErr := hcsshim.UnprepareLayer(di, layerID); layerErr != nil { - log.G(context.TODO()).WithError(layerErr).Error("failed to unprepare layer during mount failure cleanup") - } - } - }() - - volume, err := hcsshim.GetLayerMountPath(di, layerID) + // We can link the layer mount path to the given target. It is an UNC path, and it needs + // a trailing backslash. + mountPath, err := hcsshim.GetLayerMountPath(di, layerID) if err != nil { - return fmt.Errorf("failed to get volume path for layer %s: %w", m.Source, err) - } - - if len(parentLayerPaths) == 0 { - // this is a base layer. It gets mounted without going through WCIFS. We need to mount the Files - // folder, not the actual source, or the client may inadvertently remove metadata files. - volume = filepath.Join(volume, "Files") - if _, err := os.Stat(volume); err != nil { - return fmt.Errorf("no Files folder in layer %s", layerID) - } + return fmt.Errorf("failed to get layer mount path for %s: %w", m.Source, err) } - if err := bindfilter.ApplyFileBinding(target, volume, m.ReadOnly()); err != nil { - return fmt.Errorf("failed to set volume mount path for layer %s: %w", m.Source, err) - } - defer func() { - if retErr != nil { - if bindErr := bindfilter.RemoveFileBinding(target); bindErr != nil { - log.G(context.TODO()).WithError(bindErr).Error("failed to remove binding during mount failure cleanup") - } - } - }() + mountPath = mountPath + `\` - // Add an Alternate Data Stream to record the layer source. - // See https://docs.microsoft.com/en-au/archive/blogs/askcore/alternate-data-streams-in-ntfs - // for details on Alternate Data Streams. - if err := os.WriteFile(filepath.Clean(target)+":"+sourceStreamName, []byte(m.Source), 0666); err != nil { - return fmt.Errorf("failed to record source for layer %s: %w", m.Source, err) + if err = os.Symlink(mountPath, target); err != nil { + return fmt.Errorf("failed to link mount to target %s: %w", target, err) } - return nil } @@ -132,55 +85,25 @@ func (m *Mount) GetParentPaths() ([]string, error) { // Unmount the mount at the provided path func Unmount(mount string, flags int) error { - mount = filepath.Clean(mount) - adsFile := mount + ":" + sourceStreamName - var layerPath string - - if _, err := os.Lstat(adsFile); err == nil { - layerPathb, err := os.ReadFile(mount + ":" + sourceStreamName) - if err != nil { - return fmt.Errorf("failed to retrieve source for layer %s: %w", mount, err) + var ( + home, layerID = filepath.Split(mount) + di = hcsshim.DriverInfo{ + HomeDir: home, } - layerPath = string(layerPathb) - } + ) - if err := bindfilter.RemoveFileBinding(mount); err != nil { - if errors.Is(err, windows.ERROR_INVALID_PARAMETER) || errors.Is(err, windows.ERROR_NOT_FOUND) { - // not a mount point - return nil - } - return fmt.Errorf("removing mount: %w", err) + if err := hcsshim.UnprepareLayer(di, layerID); err != nil { + return fmt.Errorf("failed to unprepare layer %s: %w", mount, err) } - - if layerPath != "" { - var ( - home, layerID = filepath.Split(layerPath) - di = hcsshim.DriverInfo{ - HomeDir: home, - } - ) - - if err := hcsshim.UnprepareLayer(di, layerID); err != nil { - return fmt.Errorf("failed to unprepare layer %s: %w", mount, err) - } - - if err := hcsshim.DeactivateLayer(di, layerID); err != nil { - return fmt.Errorf("failed to deactivate layer %s: %w", mount, err) - } + if err := hcsshim.DeactivateLayer(di, layerID); err != nil { + return fmt.Errorf("failed to deactivate layer %s: %w", mount, err) } + return nil } // UnmountAll unmounts from the provided path func UnmountAll(mount string, flags int) error { - if mount == "" { - // This isn't an error, per the EINVAL handling in the Linux version - return nil - } - if _, err := os.Stat(mount); os.IsNotExist(err) { - return nil - } - return Unmount(mount, flags) } diff --git a/vendor/github.com/containerd/containerd/mount/temp.go b/vendor/github.com/containerd/containerd/mount/temp.go index 83143521ab..349c2404e0 100644 --- a/vendor/github.com/containerd/containerd/mount/temp.go +++ b/vendor/github.com/containerd/containerd/mount/temp.go @@ -67,13 +67,6 @@ func WithTempMount(ctx context.Context, mounts []Mount, f func(root string) erro return nil } -// WithReadonlyTempMount mounts the provided mounts to a temp dir as readonly, -// and pass the temp dir to f. The mounts are valid during the call to the f. -// Finally we will unmount and remove the temp dir regardless of the result of f. -func WithReadonlyTempMount(ctx context.Context, mounts []Mount, f func(root string) error) (err error) { - return WithTempMount(ctx, readonlyMounts(mounts), f) -} - func getTempDir() string { if xdg := os.Getenv("XDG_RUNTIME_DIR"); xdg != "" { return xdg diff --git a/vendor/github.com/containerd/containerd/pkg/atomicfile/file.go b/vendor/github.com/containerd/containerd/pkg/atomicfile/file.go deleted file mode 100644 index 7b870f7a78..0000000000 --- a/vendor/github.com/containerd/containerd/pkg/atomicfile/file.go +++ /dev/null @@ -1,148 +0,0 @@ -/* - Copyright The containerd Authors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ - -/* -Package atomicfile provides a mechanism (on Unix-like platforms) to present a consistent view of a file to separate -processes even while the file is being written. This is accomplished by writing a temporary file, syncing to disk, and -renaming over the destination file name. - -Partial/inconsistent reads can occur due to: - 1. A process attempting to read the file while it is being written to (both in the case of a new file with a - short/incomplete write or in the case of an existing, updated file where new bytes may be written at the beginning - but old bytes may still be present after). - 2. Concurrent goroutines leading to multiple active writers of the same file. - -The above mechanism explicitly protects against (1) as all writes are to a file with a temporary name. - -There is no explicit protection against multiple, concurrent goroutines attempting to write the same file. However, -atomically writing the file should mean only one writer will "win" and a consistent file will be visible. - -Note: atomicfile is partially implemented for Windows. The Windows codepath performs the same operations, however -Windows does not guarantee that a rename operation is atomic; a crash in the middle may leave the destination file -truncated rather than with the expected content. -*/ -package atomicfile - -import ( - "errors" - "fmt" - "io" - "os" - "path/filepath" - "sync" -) - -// File is an io.ReadWriteCloser that can also be Canceled if a change needs to be abandoned. -type File interface { - io.ReadWriteCloser - // Cancel abandons a change to a file. This can be called if a write fails or another error occurs. - Cancel() error -} - -// ErrClosed is returned if Read or Write are called on a closed File. -var ErrClosed = errors.New("file is closed") - -// New returns a new atomic file. On Unix-like platforms, the writer (an io.ReadWriteCloser) is backed by a temporary -// file placed into the same directory as the destination file (using filepath.Dir to split the directory from the -// name). On a call to Close the temporary file is synced to disk and renamed to its final name, hiding any previous -// file by the same name. -// -// Note: Take care to call Close and handle any errors that are returned. Errors returned from Close may indicate that -// the file was not written with its final name. -func New(name string, mode os.FileMode) (File, error) { - return newFile(name, mode) -} - -type atomicFile struct { - name string - f *os.File - closed bool - closedMu sync.RWMutex -} - -func newFile(name string, mode os.FileMode) (File, error) { - dir := filepath.Dir(name) - f, err := os.CreateTemp(dir, "") - if err != nil { - return nil, fmt.Errorf("failed to create temp file: %w", err) - } - if err := f.Chmod(mode); err != nil { - return nil, fmt.Errorf("failed to change temp file permissions: %w", err) - } - return &atomicFile{name: name, f: f}, nil -} - -func (a *atomicFile) Close() (err error) { - a.closedMu.Lock() - defer a.closedMu.Unlock() - - if a.closed { - return nil - } - a.closed = true - - defer func() { - if err != nil { - _ = os.Remove(a.f.Name()) // ignore errors - } - }() - // The order of operations here is: - // 1. sync - // 2. close - // 3. rename - // While the ordering of 2 and 3 is not important on Unix-like operating systems, Windows cannot rename an open - // file. By closing first, we allow the rename operation to succeed. - if err = a.f.Sync(); err != nil { - return fmt.Errorf("failed to sync temp file %q: %w", a.f.Name(), err) - } - if err = a.f.Close(); err != nil { - return fmt.Errorf("failed to close temp file %q: %w", a.f.Name(), err) - } - if err = os.Rename(a.f.Name(), a.name); err != nil { - return fmt.Errorf("failed to rename %q to %q: %w", a.f.Name(), a.name, err) - } - return nil -} - -func (a *atomicFile) Cancel() error { - a.closedMu.Lock() - defer a.closedMu.Unlock() - - if a.closed { - return nil - } - a.closed = true - _ = a.f.Close() // ignore error - return os.Remove(a.f.Name()) -} - -func (a *atomicFile) Read(p []byte) (n int, err error) { - a.closedMu.RLock() - defer a.closedMu.RUnlock() - if a.closed { - return 0, ErrClosed - } - return a.f.Read(p) -} - -func (a *atomicFile) Write(p []byte) (n int, err error) { - a.closedMu.RLock() - defer a.closedMu.RUnlock() - if a.closed { - return 0, ErrClosed - } - return a.f.Write(p) -} diff --git a/vendor/github.com/containerd/containerd/plugin/context.go b/vendor/github.com/containerd/containerd/plugin/context.go index cf91678988..dcb533c8a7 100644 --- a/vendor/github.com/containerd/containerd/plugin/context.go +++ b/vendor/github.com/containerd/containerd/plugin/context.go @@ -28,13 +28,12 @@ import ( // InitContext is used for plugin initialization type InitContext struct { - Context context.Context - Root string - State string - Config interface{} - Address string - TTRPCAddress string - RegisterReadiness func() func() + Context context.Context + Root string + State string + Config interface{} + Address string + TTRPCAddress string // deprecated: will be removed in 2.0, use plugin.EventType Events *exchange.Exchange diff --git a/vendor/github.com/containerd/containerd/runtime/v2/shim/util.go b/vendor/github.com/containerd/containerd/runtime/v2/shim/util.go index fce1318a63..cb2b97f86e 100644 --- a/vendor/github.com/containerd/containerd/runtime/v2/shim/util.go +++ b/vendor/github.com/containerd/containerd/runtime/v2/shim/util.go @@ -28,15 +28,13 @@ import ( "strings" "time" - "github.com/containerd/ttrpc" - "github.com/containerd/typeurl/v2" - exec "golang.org/x/sys/execabs" - "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/namespaces" - "github.com/containerd/containerd/pkg/atomicfile" "github.com/containerd/containerd/protobuf/proto" "github.com/containerd/containerd/protobuf/types" + "github.com/containerd/ttrpc" + "github.com/containerd/typeurl/v2" + exec "golang.org/x/sys/execabs" ) type CommandConfig struct { @@ -126,16 +124,17 @@ func WritePidFile(path string, pid int) error { if err != nil { return err } - f, err := atomicfile.New(path, 0o666) + tempPath := filepath.Join(filepath.Dir(path), fmt.Sprintf(".%s", filepath.Base(path))) + f, err := os.OpenFile(tempPath, os.O_RDWR|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0666) if err != nil { return err } _, err = fmt.Fprintf(f, "%d", pid) + f.Close() if err != nil { - f.Cancel() return err } - return f.Close() + return os.Rename(tempPath, path) } // WriteAddress writes a address file atomically @@ -144,16 +143,17 @@ func WriteAddress(path, address string) error { if err != nil { return err } - f, err := atomicfile.New(path, 0o666) + tempPath := filepath.Join(filepath.Dir(path), fmt.Sprintf(".%s", filepath.Base(path))) + f, err := os.OpenFile(tempPath, os.O_RDWR|os.O_CREATE|os.O_EXCL|os.O_SYNC, 0666) if err != nil { return err } - _, err = f.Write([]byte(address)) + _, err = f.WriteString(address) + f.Close() if err != nil { - f.Cancel() return err } - return f.Close() + return os.Rename(tempPath, path) } // ErrNoAddress is returned when the address file has no content diff --git a/vendor/github.com/containerd/containerd/version/version.go b/vendor/github.com/containerd/containerd/version/version.go index b1d3be630a..c9f9dd55ec 100644 --- a/vendor/github.com/containerd/containerd/version/version.go +++ b/vendor/github.com/containerd/containerd/version/version.go @@ -23,7 +23,7 @@ var ( Package = "github.com/containerd/containerd" // Version holds the complete version number. Filled in at linking time. - Version = "1.7.3+unknown" + Version = "1.7.0+unknown" // Revision is filled with the VCS (e.g. git) revision being used to build // the program at linking time. diff --git a/vendor/github.com/containerd/continuity/fs/copy.go b/vendor/github.com/containerd/continuity/fs/copy.go index a1cae0f95b..af3abdd4c4 100644 --- a/vendor/github.com/containerd/continuity/fs/copy.go +++ b/vendor/github.com/containerd/continuity/fs/copy.go @@ -18,20 +18,13 @@ package fs import ( "fmt" + "io" "os" "path/filepath" - "sync" "github.com/sirupsen/logrus" ) -var bufferPool = &sync.Pool{ - New: func() interface{} { - buffer := make([]byte, 32*1024) - return &buffer - }, -} - // XAttrErrorHandler transform a non-nil xattr error. // Return nil to ignore an error. // xattrKey can be empty for listxattr operation. @@ -199,5 +192,6 @@ func openAndCopyFile(target, source string) error { } defer tgt.Close() - return copyFileContent(tgt, src) + _, err = io.Copy(tgt, src) + return err } diff --git a/vendor/github.com/containerd/continuity/fs/copy_linux.go b/vendor/github.com/containerd/continuity/fs/copy_linux.go index 1906e5e011..48ac3fbd37 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_linux.go +++ b/vendor/github.com/containerd/continuity/fs/copy_linux.go @@ -18,7 +18,6 @@ package fs import ( "fmt" - "io" "os" "syscall" @@ -62,51 +61,6 @@ func copyFileInfo(fi os.FileInfo, src, name string) error { return nil } -const maxSSizeT = int64(^uint(0) >> 1) - -func copyFileContent(dst, src *os.File) error { - st, err := src.Stat() - if err != nil { - return fmt.Errorf("unable to stat source: %w", err) - } - - size := st.Size() - first := true - srcFd := int(src.Fd()) - dstFd := int(dst.Fd()) - - for size > 0 { - // Ensure that we are never trying to copy more than SSIZE_MAX at a - // time and at the same time avoids overflows when the file is larger - // than 4GB on 32-bit systems. - var copySize int - if size > maxSSizeT { - copySize = int(maxSSizeT) - } else { - copySize = int(size) - } - n, err := unix.CopyFileRange(srcFd, nil, dstFd, nil, copySize, 0) - if err != nil { - if (err != unix.ENOSYS && err != unix.EXDEV) || !first { - return fmt.Errorf("copy file range failed: %w", err) - } - - buf := bufferPool.Get().(*[]byte) - _, err = io.CopyBuffer(dst, src, *buf) - bufferPool.Put(buf) - if err != nil { - return fmt.Errorf("userspace copy failed: %w", err) - } - return nil - } - - first = false - size -= int64(n) - } - - return nil -} - func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error { xattrKeys, err := sysx.LListxattr(src) if err != nil { diff --git a/vendor/github.com/containerd/continuity/fs/copy_unix.go b/vendor/github.com/containerd/continuity/fs/copy_unix.go index dd957872b4..2e25914d39 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_unix.go +++ b/vendor/github.com/containerd/continuity/fs/copy_unix.go @@ -1,5 +1,5 @@ -//go:build darwin || freebsd || openbsd || netbsd || solaris -// +build darwin freebsd openbsd netbsd solaris +//go:build darwin || freebsd || openbsd || netbsd || dragonfly || solaris +// +build darwin freebsd openbsd netbsd dragonfly solaris /* Copyright The containerd Authors. @@ -21,7 +21,6 @@ package fs import ( "fmt" - "io" "os" "runtime" "syscall" @@ -61,14 +60,6 @@ func copyFileInfo(fi os.FileInfo, src, name string) error { return nil } -func copyFileContent(dst, src *os.File) error { - buf := bufferPool.Get().(*[]byte) - _, err := io.CopyBuffer(dst, src, *buf) - bufferPool.Put(buf) - - return err -} - func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error { xattrKeys, err := sysx.LListxattr(src) if err != nil { diff --git a/vendor/github.com/containerd/continuity/fs/copy_windows.go b/vendor/github.com/containerd/continuity/fs/copy_windows.go index 6ec13b9898..1fad4c3adc 100644 --- a/vendor/github.com/containerd/continuity/fs/copy_windows.go +++ b/vendor/github.com/containerd/continuity/fs/copy_windows.go @@ -19,7 +19,6 @@ package fs import ( "errors" "fmt" - "io" "os" winio "github.com/Microsoft/go-winio" @@ -72,13 +71,6 @@ func copyFileInfo(fi os.FileInfo, src, name string) error { return nil } -func copyFileContent(dst, src *os.File) error { - buf := bufferPool.Get().(*[]byte) - _, err := io.CopyBuffer(dst, src, *buf) - bufferPool.Put(buf) - return err -} - func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error { return nil } diff --git a/vendor/github.com/containerd/continuity/fs/stat_atim.go b/vendor/github.com/containerd/continuity/fs/stat_atim.go index 996b9c1ae7..ade7bec6c9 100644 --- a/vendor/github.com/containerd/continuity/fs/stat_atim.go +++ b/vendor/github.com/containerd/continuity/fs/stat_atim.go @@ -1,5 +1,5 @@ -//go:build linux || openbsd || solaris -// +build linux openbsd solaris +//go:build linux || openbsd || dragonfly || solaris +// +build linux openbsd dragonfly solaris /* Copyright The containerd Authors. diff --git a/vendor/modules.txt b/vendor/modules.txt index 19f9fd0742..81d8f02485 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -11,7 +11,6 @@ github.com/Microsoft/go-winio/backuptar github.com/Microsoft/go-winio/internal/fs github.com/Microsoft/go-winio/internal/socket github.com/Microsoft/go-winio/internal/stringbuffer -github.com/Microsoft/go-winio/pkg/bindfilter github.com/Microsoft/go-winio/pkg/etw github.com/Microsoft/go-winio/pkg/etwlogrus github.com/Microsoft/go-winio/pkg/fs @@ -44,7 +43,7 @@ github.com/containerd/cgroups/v3/cgroup1/stats # github.com/containerd/console v1.0.3 ## explicit; go 1.13 github.com/containerd/console -# github.com/containerd/containerd v1.7.3 +# github.com/containerd/containerd v1.7.0 ## explicit; go 1.19 github.com/containerd/containerd/api/events github.com/containerd/containerd/api/runtime/task/v2 @@ -60,7 +59,6 @@ github.com/containerd/containerd/identifiers github.com/containerd/containerd/log github.com/containerd/containerd/mount github.com/containerd/containerd/namespaces -github.com/containerd/containerd/pkg/atomicfile github.com/containerd/containerd/pkg/dialer github.com/containerd/containerd/pkg/randutil github.com/containerd/containerd/pkg/shutdown @@ -76,7 +74,7 @@ github.com/containerd/containerd/runtime/v2/shim github.com/containerd/containerd/sys github.com/containerd/containerd/sys/reaper github.com/containerd/containerd/version -# github.com/containerd/continuity v0.4.1 +# github.com/containerd/continuity v0.4.2 ## explicit; go 1.19 github.com/containerd/continuity/fs github.com/containerd/continuity/sysx