Unverified Commit 0209f359 authored by Jacob Blain Christen's avatar Jacob Blain Christen Committed by GitHub

[release 1.19] containerd: v1.4.4-k3s1 (#3085)

Addresses k3s-io/k3s#3068 and CVE-2021-21334 Signed-off-by: 's avatarJacob Blain Christen <jacob@rancher.com>
parent 64017c52
...@@ -5,12 +5,12 @@ go 1.15 ...@@ -5,12 +5,12 @@ go 1.15
replace ( replace (
github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.9 github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.9
github.com/benmoss/go-powershell => github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373 github.com/benmoss/go-powershell => github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373
github.com/containerd/btrfs => github.com/containerd/btrfs v0.0.0-20181101203652-af5082808c83 github.com/containerd/btrfs => github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e
github.com/containerd/cgroups => github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 github.com/containerd/cgroups => github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340
github.com/containerd/console => github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 github.com/containerd/console => github.com/containerd/console v1.0.0
github.com/containerd/containerd => github.com/k3s-io/containerd v1.4.3-k3s3 github.com/containerd/containerd => github.com/k3s-io/containerd v1.4.4-k3s1
github.com/containerd/continuity => github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 github.com/containerd/continuity => github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1
github.com/containerd/cri => github.com/rancher/cri v1.4.0-k3s.2 // k3s-release/1.4 github.com/containerd/cri => github.com/k3s-io/cri v1.4.0-k3s.5 // k3s-release/1.4
github.com/containerd/fifo => github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c github.com/containerd/fifo => github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c
github.com/containerd/go-runc => github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328 github.com/containerd/go-runc => github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328
github.com/containerd/typeurl => github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd github.com/containerd/typeurl => github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd
...@@ -63,7 +63,7 @@ replace ( ...@@ -63,7 +63,7 @@ replace (
require ( require (
github.com/NYTimes/gziphandler v1.1.1 // indirect github.com/NYTimes/gziphandler v1.1.1 // indirect
github.com/bronze1man/goStrongswanVici v0.0.0-20190828090544-27d02f80ba40 // indirect github.com/bronze1man/goStrongswanVici v0.0.0-20190828090544-27d02f80ba40 // indirect
github.com/containerd/containerd v1.4.0 github.com/containerd/containerd v1.4.4
github.com/containerd/cri v1.11.1-0.20200820101445-b0cc07999aa5 github.com/containerd/cri v1.11.1-0.20200820101445-b0cc07999aa5
github.com/coreos/flannel v0.12.0 github.com/coreos/flannel v0.12.0
github.com/coreos/go-iptables v0.4.5 github.com/coreos/go-iptables v0.4.5
...@@ -93,7 +93,7 @@ require ( ...@@ -93,7 +93,7 @@ require (
github.com/rancher/wrangler-api v0.6.0 github.com/rancher/wrangler-api v0.6.0
github.com/robfig/cron/v3 v3.0.1 github.com/robfig/cron/v3 v3.0.1
github.com/rootless-containers/rootlesskit v0.10.0 github.com/rootless-containers/rootlesskit v0.10.0
github.com/sirupsen/logrus v1.6.0 github.com/sirupsen/logrus v1.7.0
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.6.1 github.com/stretchr/testify v1.6.1
github.com/tchap/go-patricia v2.3.0+incompatible // indirect github.com/tchap/go-patricia v2.3.0+incompatible // indirect
...@@ -101,7 +101,7 @@ require ( ...@@ -101,7 +101,7 @@ require (
go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5 go.etcd.io/etcd v0.5.0-alpha.5.0.20200819165624-17cef6e3e9d5
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0 golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3
google.golang.org/grpc v1.31.1 google.golang.org/grpc v1.31.1
gopkg.in/yaml.v2 v2.3.0 gopkg.in/yaml.v2 v2.3.0
k8s.io/api v0.19.0 k8s.io/api v0.19.0
......
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690/go.mod h1:Ulb78X89vxKYgdL24HMTiXYHlyHEvruOj1ZPlqeNEZM= bitbucket.org/bertimus9/systemstat v0.0.0-20180207000608-0eeff89b0690/go.mod h1:Ulb78X89vxKYgdL24HMTiXYHlyHEvruOj1ZPlqeNEZM=
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
...@@ -118,7 +119,6 @@ github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlR ...@@ -118,7 +119,6 @@ github.com/cheekybits/genny v0.0.0-20170328200008-9127e812e1e9/go.mod h1:+tQajlR
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200601085316-9f1617e5c574/go.mod h1:XT+cAw5wfvsodedcijoh1l9cf7v1x9FlFB/3VmF/O8s= github.com/cilium/ebpf v0.0.0-20200601085316-9f1617e5c574/go.mod h1:XT+cAw5wfvsodedcijoh1l9cf7v1x9FlFB/3VmF/O8s=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775 h1:cHzBGGVew0ezFsq2grfy2RsB8hO/eNyBgOLHBCqfR1U= github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775 h1:cHzBGGVew0ezFsq2grfy2RsB8hO/eNyBgOLHBCqfR1U=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc= github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
...@@ -129,13 +129,11 @@ github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2 ...@@ -129,13 +129,11 @@ github.com/codegangsta/negroni v1.0.0/go.mod h1:v0y3T5G7Y1UlFfyxFn/QLRU4a2EuNau2
github.com/container-storage-interface/spec v1.2.0 h1:bD9KIVgaVKKkQ/UbVUY9kCaH/CJbhNxe0eeB4JeJV2s= github.com/container-storage-interface/spec v1.2.0 h1:bD9KIVgaVKKkQ/UbVUY9kCaH/CJbhNxe0eeB4JeJV2s=
github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4= github.com/container-storage-interface/spec v1.2.0/go.mod h1:6URME8mwIBbpVyZV93Ce5St17xBiQJQY67NDsuohiy4=
github.com/containerd/aufs v0.0.0-20191030083217-371312c1e31c/go.mod h1:KWTFEKnST/R6wiSG+n7rid/ZQJxi73594So04IsWRpc= github.com/containerd/aufs v0.0.0-20191030083217-371312c1e31c/go.mod h1:KWTFEKnST/R6wiSG+n7rid/ZQJxi73594So04IsWRpc=
github.com/containerd/btrfs v0.0.0-20181101203652-af5082808c83/go.mod h1:obwvRpZTBx8yJQ/6w+6mrVoLAiS0CedRD8CCD+U7vZQ= github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e/go.mod h1:jg2QkJcsabfHugurUvvPhS3E08Oxiuh5W/g1ybB4e0E=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 h1:qWj4qVYZ95vLWwqyNJCQg7rDsG5wPdze0UaPolH7DUk= github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340 h1:9atoWyI9RtXFwf7UDbme/6M8Ud0rFrx+Q3ZWgSnsxtw=
github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59/go.mod h1:pA0z1pT8KYB3TCXK/ocprsh7MAkoW8bZVzPdih9snmM= github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340/go.mod h1:s5q4SojHctfxANBDvMeIaIovkq29IP48TKAxnhYRxvo=
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 h1:WMpHmC6AxwWb9hMqhudkqG7A/p14KiMnl6d3r1iUMjU= github.com/containerd/console v1.0.0 h1:fU3UuQapBs+zLJu82NhR11Rif1ny2zfMMAyPJzSN5tQ=
github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/console v1.0.0/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE=
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 h1:tN9D97v5A5QuKdcKHKt+UMKrkQ5YXUnD8iM7IAAjEfI=
github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02/go.mod h1:GL3xCUCBDV3CZiTSEKksMWbLE66hEyuu9qyDOOqM47Y=
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c h1:KFbqHhDeaHM7IfFtXHfUHMDaUStpM2YwBR+iJCIOsKk= github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c h1:KFbqHhDeaHM7IfFtXHfUHMDaUStpM2YwBR+iJCIOsKk=
github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/go-cni v1.0.1 h1:VXr2EkOPD0v1gu7CKfof6XzEIDzsE/dI9yj/W7PSWLs= github.com/containerd/go-cni v1.0.1 h1:VXr2EkOPD0v1gu7CKfof6XzEIDzsE/dI9yj/W7PSWLs=
...@@ -466,8 +464,12 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X ...@@ -466,8 +464,12 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/k3s-io/containerd v1.4.3-k3s3 h1:cCczsk6P0KYYnFuh4FauXNMDcNl2LmDilCD6igR71WU= github.com/k3s-io/containerd v1.4.4-k3s1 h1:9D9ynaNMW0vT/Kycr7qLstBGby6T84iJpbKFXKGhAPk=
github.com/k3s-io/containerd v1.4.3-k3s3/go.mod h1:qHmUrsocqXRZQBvPKgoYfsBDfZ/tCtPta97L+VXqbak= github.com/k3s-io/containerd v1.4.4-k3s1/go.mod h1:M0uyTU3ZQ0WEBn5YcYPDs/7LpW/0mqjt5im7Wn2z1kc=
github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1 h1:KEz2rd9IDbrQT8w6RibEYlwfTXiu0P6hQDE+6O4IJdI=
github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
github.com/k3s-io/cri v1.4.0-k3s.5 h1:Uh7QkRKibPJqSBbtCtgpjYsdNVcx3Tx+7HHlhxKBtu8=
github.com/k3s-io/cri v1.4.0-k3s.5/go.mod h1:fGPUUHMKQik/vIegSe05DtX/m4miovdtvVLqRUFAkK0=
github.com/k3s-io/etcd v0.5.0-alpha.5.0.20201208200253-50621aee4aea h1:7cwby0GoNAi8IsVrT0q+JfQpB6V76ZaEGhj6qts/mvU= github.com/k3s-io/etcd v0.5.0-alpha.5.0.20201208200253-50621aee4aea h1:7cwby0GoNAi8IsVrT0q+JfQpB6V76ZaEGhj6qts/mvU=
github.com/k3s-io/etcd v0.5.0-alpha.5.0.20201208200253-50621aee4aea/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg= github.com/k3s-io/etcd v0.5.0-alpha.5.0.20201208200253-50621aee4aea/go.mod h1:yVHk9ub3CSBatqGNg7GRmsnfLWtoW60w4eDYfh7vHDg=
github.com/k3s-io/helm-controller v0.8.3 h1:GWxavyMz7Bw2ClxH5okkeOL8o5U6IBK7uauc44SDCjU= github.com/k3s-io/helm-controller v0.8.3 h1:GWxavyMz7Bw2ClxH5okkeOL8o5U6IBK7uauc44SDCjU=
...@@ -696,8 +698,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T ...@@ -696,8 +698,6 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI= github.com/quobyte/api v0.1.2/go.mod h1:jL7lIHrmqQ7yh05OJ+eEEdHr0u/kmT1Ff9iHd+4H6VI=
github.com/rakelkar/gonetsh v0.0.0-20190930180311-e5c5ffe4bdf0 h1:iXE9kmlAqhusXxzkXictdNgWS7p4ZBnmv9SdyMgTf6E= github.com/rakelkar/gonetsh v0.0.0-20190930180311-e5c5ffe4bdf0 h1:iXE9kmlAqhusXxzkXictdNgWS7p4ZBnmv9SdyMgTf6E=
github.com/rakelkar/gonetsh v0.0.0-20190930180311-e5c5ffe4bdf0/go.mod h1:4XHkfaUj+URzGO9sohoAgt2V9Y8nIW7fugpu0E6gShk= github.com/rakelkar/gonetsh v0.0.0-20190930180311-e5c5ffe4bdf0/go.mod h1:4XHkfaUj+URzGO9sohoAgt2V9Y8nIW7fugpu0E6gShk=
github.com/rancher/cri v1.4.0-k3s.2 h1:fX9dGTD9xu6eKB2EDgla2DZHlyusZZzS/hVHvQd3UaQ=
github.com/rancher/cri v1.4.0-k3s.2/go.mod h1:Ht5T1dIKzm+4NExmb7wDVG6qR+j0xeXIjjhCv1d9geY=
github.com/rancher/cri-tools v1.19.0-k3s1 h1:c6lqNWyoAB5+NaUREbpZxKXCuYl9he24/DZEgHywg+A= github.com/rancher/cri-tools v1.19.0-k3s1 h1:c6lqNWyoAB5+NaUREbpZxKXCuYl9he24/DZEgHywg+A=
github.com/rancher/cri-tools v1.19.0-k3s1/go.mod h1:bitvtZRi5F7t505Yw3zPzp22LOao1lqJKHfx6x0hnpw= github.com/rancher/cri-tools v1.19.0-k3s1/go.mod h1:bitvtZRi5F7t505Yw3zPzp22LOao1lqJKHfx6x0hnpw=
github.com/rancher/dynamiclistener v0.2.2 h1:70dMwOr1sqb6mQqfU2nDb/fr5cv7HJjH+kFYzoxb8KU= github.com/rancher/dynamiclistener v0.2.2 h1:70dMwOr1sqb6mQqfU2nDb/fr5cv7HJjH+kFYzoxb8KU=
...@@ -751,6 +751,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB ...@@ -751,6 +751,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E=
...@@ -760,12 +762,14 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B ...@@ -760,12 +762,14 @@ github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
......
#!/bin/sh #!/bin/bash
set -e set -e
...@@ -6,12 +6,25 @@ if [ "${DEBUG}" = 1 ]; then ...@@ -6,12 +6,25 @@ if [ "${DEBUG}" = 1 ]; then
set -x set -x
fi fi
cd $(dirname $0)/..
. ./scripts/version.sh
MAX_BINARY_SIZE=61000000 MAX_BINARY_SIZE=61000000
SIZE=$(ls -l dist/artifacts/k3s | awk -F ' ' '{print $5}') BIN_SUFFIX="-${ARCH}"
if [ ${ARCH} = amd64 ]; then
BIN_SUFFIX=""
elif [ ${ARCH} = arm ]; then
BIN_SUFFIX="-armhf"
fi
CMD_NAME="dist/artifacts/k3s${BIN_SUFFIX}"
SIZE=$(stat -c '%s' ${CMD_NAME})
if [ ${SIZE} -gt ${MAX_BINARY_SIZE} ]; then if [ ${SIZE} -gt ${MAX_BINARY_SIZE} ]; then
echo "k3s binary exceeds acceptable size of "${MAX_BINARY_SIZE} echo "k3s binary ${CMD_NAME} size ${SIZE} exceeds max acceptable size of ${MAX_BINARY_SIZE} bytes"
exit 1 exit 1
fi fi
echo "k3s binary ${CMD_NAME} size ${SIZE} is less than max acceptable size of ${MAX_BINARY_SIZE} bytes"
exit 0 exit 0
dist: bionic
language: go
go:
- 1.13.x
cache:
directories:
- /home/travis/.vagrant.d/boxes
matrix:
include:
- name: "cgroup-v2"
env:
- VAGRANT_VERSION=2.2.7
- FEDORA_VERSION=32
# https://github.com/opencontainers/runc/blob/b207d578ec2d70e20ca6cfa8a32e49ef59dd48dd/.travis.yml#L23-L42
install:
- cat /proc/cpuinfo
- sudo apt-get install -q -y bridge-utils dnsmasq-base ebtables libvirt-bin libvirt-dev qemu-kvm qemu-utils ruby-dev && wget https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_$(uname -m).deb && sudo dpkg -i vagrant_${VAGRANT_VERSION}_$(uname -m).deb && rm -f vagrant_${VAGRANT_VERSION}_$(uname -m).deb
- sudo vagrant plugin install vagrant-libvirt
- sudo vagrant up && sudo mkdir -p /root/.ssh && sudo sh -c "vagrant ssh-config >> /root/.ssh/config"
script:
- sudo ssh default sudo mkdir -p /go/src/github.com/containerd/cgroups
- ( cd $GOPATH/src/github.com/containerd/cgroups && tar c . ) | sudo ssh default sudo tar Cxv /go/src/github.com/containerd/cgroups
# see https://unix.stackexchange.com/questions/80821/why-does-cd-command-not-work-via-ssh
- sudo ssh default sudo 'bash -xec "cd /go/src/github.com/containerd/cgroups && pwd && ls -la && GOPATH=/go go test -v ./..."'
install:
- go get -u github.com/vbatts/git-validation
- go get -u github.com/kunalkushwaha/ltag
before_script:
- pushd ..; git clone https://github.com/containerd/project; popd
script:
- DCO_VERBOSITY=-q ../project/script/validate/dco
- ../project/script/validate/fileheader ../project/
- go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
after_success:
- bash <(curl -s https://codecov.io/bash)
# cgroups # cgroups
[![Build Status](https://travis-ci.org/containerd/cgroups.svg?branch=master)](https://travis-ci.org/containerd/cgroups) [![Build Status](https://github.com/containerd/cgroups/workflows/CI/badge.svg)](https://github.com/containerd/cgroups/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/containerd/cgroups/branch/master/graph/badge.svg)](https://codecov.io/gh/containerd/cgroups) [![codecov](https://codecov.io/gh/containerd/cgroups/branch/master/graph/badge.svg)](https://codecov.io/gh/containerd/cgroups)
[![GoDoc](https://godoc.org/github.com/containerd/cgroups?status.svg)](https://godoc.org/github.com/containerd/cgroups) [![GoDoc](https://godoc.org/github.com/containerd/cgroups?status.svg)](https://godoc.org/github.com/containerd/cgroups)
[![Go Report Card](https://goreportcard.com/badge/github.com/containerd/cgroups)](https://goreportcard.com/report/github.com/containerd/cgroups) [![Go Report Card](https://goreportcard.com/badge/github.com/containerd/cgroups)](https://goreportcard.com/report/github.com/containerd/cgroups)
...@@ -65,7 +65,7 @@ To update the resources applied in the cgroup ...@@ -65,7 +65,7 @@ To update the resources applied in the cgroup
```go ```go
shares = uint64(200) shares = uint64(200)
if err := control.Update(&specs.LinuxResources{ if err := control.Update(&specs.LinuxResources{
CPU: &specs.CPU{ CPU: &specs.LinuxCPU{
Shares: &shares, Shares: &shares,
}, },
}); err != nil { }); err != nil {
......
...@@ -13,13 +13,34 @@ Vagrant.configure("2") do |config| ...@@ -13,13 +13,34 @@ Vagrant.configure("2") do |config|
v.cpus = 2 v.cpus = 2
end end
config.vm.provision "shell", inline: <<-SHELL config.vm.provision "shell", inline: <<-SHELL
cat << EOF | dnf -y shell set -eux -o pipefail
config exclude kernel,kernel-core # configuration
config install_weak_deps false GO_VERSION="1.13.12"
update
install git golang-go # install gcc and Golang
ts run dnf -y install gcc
curl -fsSL "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" | tar Cxz /usr/local
# setup env vars
cat >> /etc/profile.d/sh.local <<EOF
PATH=/usr/local/go/bin:$PATH
GO111MODULE=on
export PATH GO111MODULE
EOF
source /etc/profile.d/sh.local
# enter /root/go/src/github.com/containerd/cgroups
mkdir -p /root/go/src/github.com/containerd
ln -s /vagrant /root/go/src/github.com/containerd/cgroups
cd /root/go/src/github.com/containerd/cgroups
# create /test.sh
cat > /test.sh <<EOF
#!/bin/bash
set -eux -o pipefail
cd /root/go/src/github.com/containerd/cgroups
go test -v ./...
EOF EOF
dnf clean all chmod +x /test.sh
SHELL SHELL
end end
...@@ -20,7 +20,6 @@ import ( ...@@ -20,7 +20,6 @@ import (
"bufio" "bufio"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
...@@ -72,8 +71,8 @@ func (b *blkioController) Create(path string, resources *specs.LinuxResources) e ...@@ -72,8 +71,8 @@ func (b *blkioController) Create(path string, resources *specs.LinuxResources) e
} }
for _, t := range createBlkioSettings(resources.BlockIO) { for _, t := range createBlkioSettings(resources.BlockIO) {
if t.value != nil { if t.value != nil {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(b.Path(path), fmt.Sprintf("blkio.%s", t.name)), filepath.Join(b.Path(path), "blkio."+t.name),
t.format(t.value), t.format(t.value),
defaultFilePerm, defaultFilePerm,
); err != nil { ); err != nil {
...@@ -94,7 +93,7 @@ func (b *blkioController) Stat(path string, stats *v1.Metrics) error { ...@@ -94,7 +93,7 @@ func (b *blkioController) Stat(path string, stats *v1.Metrics) error {
var settings []blkioStatSettings var settings []blkioStatSettings
// Try to read CFQ stats available on all CFQ enabled kernels first // Try to read CFQ stats available on all CFQ enabled kernels first
if _, err := os.Lstat(filepath.Join(b.Path(path), fmt.Sprintf("blkio.io_serviced_recursive"))); err == nil { if _, err := os.Lstat(filepath.Join(b.Path(path), "blkio.io_serviced_recursive")); err == nil {
settings = []blkioStatSettings{ settings = []blkioStatSettings{
{ {
name: "sectors_recursive", name: "sectors_recursive",
...@@ -174,7 +173,7 @@ func (b *blkioController) Stat(path string, stats *v1.Metrics) error { ...@@ -174,7 +173,7 @@ func (b *blkioController) Stat(path string, stats *v1.Metrics) error {
} }
func (b *blkioController) readEntry(devices map[deviceKey]string, path, name string, entry *[]*v1.BlkIOEntry) error { func (b *blkioController) readEntry(devices map[deviceKey]string, path, name string, entry *[]*v1.BlkIOEntry) error {
f, err := os.Open(filepath.Join(b.Path(path), fmt.Sprintf("blkio.%s", name))) f, err := os.Open(filepath.Join(b.Path(path), "blkio."+name))
if err != nil { if err != nil {
return err return err
} }
...@@ -188,7 +187,7 @@ func (b *blkioController) readEntry(devices map[deviceKey]string, path, name str ...@@ -188,7 +187,7 @@ func (b *blkioController) readEntry(devices map[deviceKey]string, path, name str
// skip total line // skip total line
continue continue
} else { } else {
return fmt.Errorf("Invalid line found while parsing %s: %s", path, sc.Text()) return fmt.Errorf("invalid line found while parsing %s: %s", path, sc.Text())
} }
} }
major, err := strconv.ParseUint(fields[0], 10, 64) major, err := strconv.ParseUint(fields[0], 10, 64)
...@@ -357,11 +356,3 @@ func getDevices(r io.Reader) (map[deviceKey]string, error) { ...@@ -357,11 +356,3 @@ func getDevices(r io.Reader) (map[deviceKey]string, error) {
} }
return devices, s.Err() return devices, s.Err()
} }
func major(devNumber uint64) uint64 {
return (devNumber >> 8) & 0xfff
}
func minor(devNumber uint64) uint64 {
return (devNumber & 0xff) | ((devNumber >> 12) & 0xfff00)
}
...@@ -18,7 +18,6 @@ package cgroups ...@@ -18,7 +18,6 @@ package cgroups
import ( import (
"fmt" "fmt"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
...@@ -169,7 +168,7 @@ func (c *cgroup) add(process Process) error { ...@@ -169,7 +168,7 @@ func (c *cgroup) add(process Process) error {
if err != nil { if err != nil {
return err return err
} }
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(s.Path(p), cgroupProcs), filepath.Join(s.Path(p), cgroupProcs),
[]byte(strconv.Itoa(process.Pid)), []byte(strconv.Itoa(process.Pid)),
defaultFilePerm, defaultFilePerm,
...@@ -199,7 +198,7 @@ func (c *cgroup) addTask(process Process) error { ...@@ -199,7 +198,7 @@ func (c *cgroup) addTask(process Process) error {
if err != nil { if err != nil {
return err return err
} }
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(s.Path(p), cgroupTasks), filepath.Join(s.Path(p), cgroupTasks),
[]byte(strconv.Itoa(process.Pid)), []byte(strconv.Itoa(process.Pid)),
defaultFilePerm, defaultFilePerm,
...@@ -217,7 +216,7 @@ func (c *cgroup) Delete() error { ...@@ -217,7 +216,7 @@ func (c *cgroup) Delete() error {
if c.err != nil { if c.err != nil {
return c.err return c.err
} }
var errors []string var errs []string
for _, s := range c.subsystems { for _, s := range c.subsystems {
if d, ok := s.(deleter); ok { if d, ok := s.(deleter); ok {
sp, err := c.path(s.Name()) sp, err := c.path(s.Name())
...@@ -225,7 +224,7 @@ func (c *cgroup) Delete() error { ...@@ -225,7 +224,7 @@ func (c *cgroup) Delete() error {
return err return err
} }
if err := d.Delete(sp); err != nil { if err := d.Delete(sp); err != nil {
errors = append(errors, string(s.Name())) errs = append(errs, string(s.Name()))
} }
continue continue
} }
...@@ -236,12 +235,12 @@ func (c *cgroup) Delete() error { ...@@ -236,12 +235,12 @@ func (c *cgroup) Delete() error {
} }
path := p.Path(sp) path := p.Path(sp)
if err := remove(path); err != nil { if err := remove(path); err != nil {
errors = append(errors, path) errs = append(errs, path)
} }
} }
} }
if len(errors) > 0 { if len(errs) > 0 {
return fmt.Errorf("cgroups: unable to remove paths %s", strings.Join(errors, ", ")) return fmt.Errorf("cgroups: unable to remove paths %s", strings.Join(errs, ", "))
} }
c.err = ErrCgroupDeleted c.err = ErrCgroupDeleted
return nil return nil
......
...@@ -18,8 +18,6 @@ package cgroups ...@@ -18,8 +18,6 @@ package cgroups
import ( import (
"bufio" "bufio"
"fmt"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
...@@ -84,8 +82,8 @@ func (c *cpuController) Create(path string, resources *specs.LinuxResources) err ...@@ -84,8 +82,8 @@ func (c *cpuController) Create(path string, resources *specs.LinuxResources) err
value = []byte(strconv.FormatInt(*t.ivalue, 10)) value = []byte(strconv.FormatInt(*t.ivalue, 10))
} }
if value != nil { if value != nil {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(c.Path(path), fmt.Sprintf("cpu.%s", t.name)), filepath.Join(c.Path(path), "cpu."+t.name),
value, value,
defaultFilePerm, defaultFilePerm,
); err != nil { ); err != nil {
......
...@@ -26,7 +26,7 @@ import ( ...@@ -26,7 +26,7 @@ import (
specs "github.com/opencontainers/runtime-spec/specs-go" specs "github.com/opencontainers/runtime-spec/specs-go"
) )
func NewCputset(root string) *cpusetController { func NewCpuset(root string) *cpusetController {
return &cpusetController{ return &cpusetController{
root: filepath.Join(root, string(Cpuset)), root: filepath.Join(root, string(Cpuset)),
} }
...@@ -69,8 +69,8 @@ func (c *cpusetController) Create(path string, resources *specs.LinuxResources) ...@@ -69,8 +69,8 @@ func (c *cpusetController) Create(path string, resources *specs.LinuxResources)
}, },
} { } {
if t.value != "" { if t.value != "" {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(c.Path(path), fmt.Sprintf("cpuset.%s", t.name)), filepath.Join(c.Path(path), "cpuset."+t.name),
[]byte(t.value), []byte(t.value),
defaultFilePerm, defaultFilePerm,
); err != nil { ); err != nil {
...@@ -134,7 +134,7 @@ func (c *cpusetController) copyIfNeeded(current, parent string) error { ...@@ -134,7 +134,7 @@ func (c *cpusetController) copyIfNeeded(current, parent string) error {
return err return err
} }
if isEmpty(currentCpus) { if isEmpty(currentCpus) {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(current, "cpuset.cpus"), filepath.Join(current, "cpuset.cpus"),
parentCpus, parentCpus,
defaultFilePerm, defaultFilePerm,
...@@ -143,7 +143,7 @@ func (c *cpusetController) copyIfNeeded(current, parent string) error { ...@@ -143,7 +143,7 @@ func (c *cpusetController) copyIfNeeded(current, parent string) error {
} }
} }
if isEmpty(currentMems) { if isEmpty(currentMems) {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(current, "cpuset.mems"), filepath.Join(current, "cpuset.mems"),
parentMems, parentMems,
defaultFilePerm, defaultFilePerm,
......
...@@ -18,7 +18,6 @@ package cgroups ...@@ -18,7 +18,6 @@ package cgroups
import ( import (
"fmt" "fmt"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
...@@ -61,7 +60,7 @@ func (d *devicesController) Create(path string, resources *specs.LinuxResources) ...@@ -61,7 +60,7 @@ func (d *devicesController) Create(path string, resources *specs.LinuxResources)
if device.Type == "" { if device.Type == "" {
device.Type = "a" device.Type = "a"
} }
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(d.Path(path), file), filepath.Join(d.Path(path), file),
[]byte(deviceString(device)), []byte(deviceString(device)),
defaultFilePerm, defaultFilePerm,
......
...@@ -50,7 +50,7 @@ func (f *freezerController) Thaw(path string) error { ...@@ -50,7 +50,7 @@ func (f *freezerController) Thaw(path string) error {
} }
func (f *freezerController) changeState(path string, state State) error { func (f *freezerController) changeState(path string, state State) error {
return ioutil.WriteFile( return retryingWriteFile(
filepath.Join(f.root, path, "freezer.state"), filepath.Join(f.root, path, "freezer.state"),
[]byte(strings.ToUpper(string(state))), []byte(strings.ToUpper(string(state))),
defaultFilePerm, defaultFilePerm,
......
...@@ -3,17 +3,16 @@ module github.com/containerd/cgroups ...@@ -3,17 +3,16 @@ module github.com/containerd/cgroups
go 1.13 go 1.13
require ( require (
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3 github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775
github.com/coreos/go-systemd/v22 v22.0.0 github.com/coreos/go-systemd/v22 v22.0.0
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
github.com/docker/go-units v0.4.0 github.com/docker/go-units v0.4.0
github.com/godbus/dbus/v5 v5.0.3 github.com/godbus/dbus/v5 v5.0.3
github.com/gogo/protobuf v1.3.1 github.com/gogo/protobuf v1.3.1
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/opencontainers/runtime-spec v1.0.2 github.com/opencontainers/runtime-spec v1.0.2
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.4.2 github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.2.2 github.com/stretchr/testify v1.2.2
github.com/urfave/cli v1.22.2 github.com/urfave/cli v1.22.2
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9
) )
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3 h1:i8+1fuPLjSgAYXUyBlHNhFwjcfAsP4ufiuH1+PWkyDU= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3 h1:i8+1fuPLjSgAYXUyBlHNhFwjcfAsP4ufiuH1+PWkyDU=
github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg= github.com/cilium/ebpf v0.0.0-20200110133405-4032b1d8aae3/go.mod h1:MA5e5Lr8slmEg9bt0VpxxWqJlO4iwu3FBdHUzV7wQVg=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775 h1:cHzBGGVew0ezFsq2grfy2RsB8hO/eNyBgOLHBCqfR1U=
github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLIdUjrmSXlK9pkrsDlLHbO8jiB8X8JnOc=
github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28= github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28=
github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk= github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
...@@ -16,9 +18,8 @@ github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= ...@@ -16,9 +18,8 @@ github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0= github.com/opencontainers/runtime-spec v1.0.2 h1:UfAcuLBJB9Coz72x1hgl8O5RVzTdNiaglX6v2DM6FI0=
github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
...@@ -30,9 +31,8 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0 ...@@ -30,9 +31,8 @@ github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo= github.com/urfave/cli v1.22.2 h1:gsqYFH8bb9ekPA12kRo0hfjngWQjkJPlN9R0N78BoUo=
...@@ -41,6 +41,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w ...@@ -41,6 +41,8 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 h1:LhLiKguPgZL+Tglay4GhVtfF0kb8cvOJ0dHTCBO8YNI= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479 h1:LhLiKguPgZL+Tglay4GhVtfF0kb8cvOJ0dHTCBO8YNI=
golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200120151820-655fe14d7479/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9 h1:1/DFK4b7JH8DmkqhUk48onnSfrPzImPoVxuomtbT2nk=
golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package cgroups package cgroups
import ( import (
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
...@@ -57,7 +56,7 @@ func (h *hugetlbController) Create(path string, resources *specs.LinuxResources) ...@@ -57,7 +56,7 @@ func (h *hugetlbController) Create(path string, resources *specs.LinuxResources)
return err return err
} }
for _, limit := range resources.HugepageLimits { for _, limit := range resources.HugepageLimits {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", limit.Pagesize, "limit_in_bytes"}, ".")), filepath.Join(h.Path(path), strings.Join([]string{"hugetlb", limit.Pagesize, "limit_in_bytes"}, ".")),
[]byte(strconv.FormatUint(limit.Limit, 10)), []byte(strconv.FormatUint(limit.Limit, 10)),
defaultFilePerm, defaultFilePerm,
......
...@@ -20,7 +20,6 @@ import ( ...@@ -20,7 +20,6 @@ import (
"bufio" "bufio"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
...@@ -214,7 +213,7 @@ func (m *memoryController) Create(path string, resources *specs.LinuxResources) ...@@ -214,7 +213,7 @@ func (m *memoryController) Create(path string, resources *specs.LinuxResources)
// until a limit is set on the cgroup and limit cannot be set once the // until a limit is set on the cgroup and limit cannot be set once the
// cgroup has children, or if there are already tasks in the cgroup. // cgroup has children, or if there are already tasks in the cgroup.
for _, i := range []int64{1, -1} { for _, i := range []int64{1, -1} {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(m.Path(path), "memory.kmem.limit_in_bytes"), filepath.Join(m.Path(path), "memory.kmem.limit_in_bytes"),
[]byte(strconv.FormatInt(i, 10)), []byte(strconv.FormatInt(i, 10)),
defaultFilePerm, defaultFilePerm,
...@@ -378,8 +377,8 @@ func (m *memoryController) parseStats(r io.Reader, stat *v1.MemoryStat) error { ...@@ -378,8 +377,8 @@ func (m *memoryController) parseStats(r io.Reader, stat *v1.MemoryStat) error {
func (m *memoryController) set(path string, settings []memorySettings) error { func (m *memoryController) set(path string, settings []memorySettings) error {
for _, t := range settings { for _, t := range settings {
if t.value != nil { if t.value != nil {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(m.Path(path), fmt.Sprintf("memory.%s", t.name)), filepath.Join(m.Path(path), "memory."+t.name),
[]byte(strconv.FormatInt(*t.value, 10)), []byte(strconv.FormatInt(*t.value, 10)),
defaultFilePerm, defaultFilePerm,
); err != nil { ); err != nil {
...@@ -468,7 +467,7 @@ func (m *memoryController) memoryEvent(path string, event MemoryEvent) (uintptr, ...@@ -468,7 +467,7 @@ func (m *memoryController) memoryEvent(path string, event MemoryEvent) (uintptr,
defer evtFile.Close() defer evtFile.Close()
data := fmt.Sprintf("%d %d %s", efd, evtFile.Fd(), event.Arg()) data := fmt.Sprintf("%d %d %s", efd, evtFile.Fd(), event.Arg())
evctlPath := filepath.Join(root, "cgroup.event_control") evctlPath := filepath.Join(root, "cgroup.event_control")
if err := ioutil.WriteFile(evctlPath, []byte(data), 0700); err != nil { if err := retryingWriteFile(evctlPath, []byte(data), 0700); err != nil {
unix.Close(efd) unix.Close(efd)
return 0, err return 0, err
} }
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package cgroups package cgroups
import ( import (
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
...@@ -48,7 +47,7 @@ func (n *netclsController) Create(path string, resources *specs.LinuxResources) ...@@ -48,7 +47,7 @@ func (n *netclsController) Create(path string, resources *specs.LinuxResources)
return err return err
} }
if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 { if resources.Network != nil && resources.Network.ClassID != nil && *resources.Network.ClassID > 0 {
return ioutil.WriteFile( return retryingWriteFile(
filepath.Join(n.Path(path), "net_cls.classid"), filepath.Join(n.Path(path), "net_cls.classid"),
[]byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)), []byte(strconv.FormatUint(uint64(*resources.Network.ClassID), 10)),
defaultFilePerm, defaultFilePerm,
......
...@@ -18,7 +18,6 @@ package cgroups ...@@ -18,7 +18,6 @@ package cgroups
import ( import (
"fmt" "fmt"
"io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
...@@ -49,7 +48,7 @@ func (n *netprioController) Create(path string, resources *specs.LinuxResources) ...@@ -49,7 +48,7 @@ func (n *netprioController) Create(path string, resources *specs.LinuxResources)
} }
if resources.Network != nil { if resources.Network != nil {
for _, prio := range resources.Network.Priorities { for _, prio := range resources.Network.Priorities {
if err := ioutil.WriteFile( if err := retryingWriteFile(
filepath.Join(n.Path(path), "net_prio.ifpriomap"), filepath.Join(n.Path(path), "net_prio.ifpriomap"),
formatPrio(prio.Name, prio.Priority), formatPrio(prio.Name, prio.Priority),
defaultFilePerm, defaultFilePerm,
......
...@@ -48,12 +48,12 @@ func newInitConfig() *InitConfig { ...@@ -48,12 +48,12 @@ func newInitConfig() *InitConfig {
type InitCheck func(Subsystem, Path, error) error type InitCheck func(Subsystem, Path, error) error
// AllowAny allows any subsystem errors to be skipped // AllowAny allows any subsystem errors to be skipped
func AllowAny(s Subsystem, p Path, err error) error { func AllowAny(_ Subsystem, _ Path, _ error) error {
return ErrIgnoreSubsystem return ErrIgnoreSubsystem
} }
// RequireDevices requires the device subsystem but no others // RequireDevices requires the device subsystem but no others
func RequireDevices(s Subsystem, p Path, err error) error { func RequireDevices(s Subsystem, _ Path, _ error) error {
if s.Name() == Devices { if s.Name() == Devices {
return ErrDevicesRequired return ErrDevicesRequired
} }
......
...@@ -25,7 +25,7 @@ import ( ...@@ -25,7 +25,7 @@ import (
type Path func(subsystem Name) (string, error) type Path func(subsystem Name) (string, error)
func RootPath(subsysem Name) (string, error) { func RootPath(subsystem Name) (string, error) {
return "/", nil return "/", nil
} }
...@@ -63,7 +63,7 @@ var ErrControllerNotActive = errors.New("controller is not supported") ...@@ -63,7 +63,7 @@ var ErrControllerNotActive = errors.New("controller is not supported")
func existingPath(paths map[string]string, suffix string) Path { func existingPath(paths map[string]string, suffix string) Path {
// localize the paths based on the root mount dest for nested cgroups // localize the paths based on the root mount dest for nested cgroups
for n, p := range paths { for n, p := range paths {
dest, err := getCgroupDestination(string(n)) dest, err := getCgroupDestination(n)
if err != nil { if err != nil {
return errorPath(err) return errorPath(err)
} }
...@@ -79,7 +79,7 @@ func existingPath(paths map[string]string, suffix string) Path { ...@@ -79,7 +79,7 @@ func existingPath(paths map[string]string, suffix string) Path {
return func(name Name) (string, error) { return func(name Name) (string, error) {
root, ok := paths[string(name)] root, ok := paths[string(name)]
if !ok { if !ok {
if root, ok = paths[fmt.Sprintf("name=%s", name)]; !ok { if root, ok = paths["name="+string(name)]; !ok {
return "", ErrControllerNotActive return "", ErrControllerNotActive
} }
} }
......
...@@ -50,7 +50,7 @@ func (p *pidsController) Create(path string, resources *specs.LinuxResources) er ...@@ -50,7 +50,7 @@ func (p *pidsController) Create(path string, resources *specs.LinuxResources) er
return err return err
} }
if resources.Pids != nil && resources.Pids.Limit > 0 { if resources.Pids != nil && resources.Pids.Limit > 0 {
return ioutil.WriteFile( return retryingWriteFile(
filepath.Join(p.Path(path), "pids.max"), filepath.Join(p.Path(path), "pids.max"),
[]byte(strconv.FormatInt(resources.Pids.Limit, 10)), []byte(strconv.FormatInt(resources.Pids.Limit, 10)),
defaultFilePerm, defaultFilePerm,
......
...@@ -67,7 +67,7 @@ func (p *rdmaController) Create(path string, resources *specs.LinuxResources) er ...@@ -67,7 +67,7 @@ func (p *rdmaController) Create(path string, resources *specs.LinuxResources) er
for device, limit := range resources.Rdma { for device, limit := range resources.Rdma {
if device != "" && (limit.HcaHandles != nil || limit.HcaObjects != nil) { if device != "" && (limit.HcaHandles != nil || limit.HcaObjects != nil) {
return ioutil.WriteFile( return retryingWriteFile(
filepath.Join(p.Path(path), "rdma.max"), filepath.Join(p.Path(path), "rdma.max"),
[]byte(createCmdString(device, &limit)), []byte(createCmdString(device, &limit)),
defaultFilePerm, defaultFilePerm,
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
package cgroups package cgroups
import ( import (
"fmt"
"path/filepath" "path/filepath"
"strings" "strings"
"sync" "sync"
...@@ -78,7 +77,7 @@ func (s *SystemdController) Name() Name { ...@@ -78,7 +77,7 @@ func (s *SystemdController) Name() Name {
return SystemdDbus return SystemdDbus
} }
func (s *SystemdController) Create(path string, resources *specs.LinuxResources) error { func (s *SystemdController) Create(path string, _ *specs.LinuxResources) error {
conn, err := systemdDbus.New() conn, err := systemdDbus.New()
if err != nil { if err != nil {
return err return err
...@@ -105,7 +104,7 @@ func (s *SystemdController) Create(path string, resources *specs.LinuxResources) ...@@ -105,7 +104,7 @@ func (s *SystemdController) Create(path string, resources *specs.LinuxResources)
} }
once.Do(checkDelegate) once.Do(checkDelegate)
properties := []systemdDbus.Property{ properties := []systemdDbus.Property{
systemdDbus.PropDescription(fmt.Sprintf("cgroup %s", name)), systemdDbus.PropDescription("cgroup " + name),
systemdDbus.PropWants(slice), systemdDbus.PropWants(slice),
newProperty("DefaultDependencies", false), newProperty("DefaultDependencies", false),
newProperty("MemoryAccounting", true), newProperty("MemoryAccounting", true),
...@@ -150,10 +149,6 @@ func newProperty(name string, units interface{}) systemdDbus.Property { ...@@ -150,10 +149,6 @@ func newProperty(name string, units interface{}) systemdDbus.Property {
} }
} }
func unitName(name string) string {
return fmt.Sprintf("%s.slice", name)
}
func splitName(path string) (slice string, unit string) { func splitName(path string) (slice string, unit string) {
slice, unit = filepath.Split(path) slice, unit = filepath.Split(path)
return strings.TrimSuffix(slice, "/"), unit return strings.TrimSuffix(slice, "/"), unit
......
...@@ -18,6 +18,7 @@ package cgroups ...@@ -18,6 +18,7 @@ package cgroups
import ( import (
"bufio" "bufio"
"errors"
"fmt" "fmt"
"io" "io"
"io/ioutil" "io/ioutil"
...@@ -26,6 +27,7 @@ import ( ...@@ -26,6 +27,7 @@ import (
"strconv" "strconv"
"strings" "strings"
"sync" "sync"
"syscall"
"time" "time"
units "github.com/docker/go-units" units "github.com/docker/go-units"
...@@ -121,7 +123,7 @@ func defaults(root string) ([]Subsystem, error) { ...@@ -121,7 +123,7 @@ func defaults(root string) ([]Subsystem, error) {
NewNetCls(root), NewNetCls(root),
NewNetPrio(root), NewNetPrio(root),
NewPerfEvent(root), NewPerfEvent(root),
NewCputset(root), NewCpuset(root),
NewCpu(root), NewCpu(root),
NewCpuacct(root), NewCpuacct(root),
NewMemory(root), NewMemory(root),
...@@ -380,5 +382,18 @@ func cleanPath(path string) string { ...@@ -380,5 +382,18 @@ func cleanPath(path string) string {
if !filepath.IsAbs(path) { if !filepath.IsAbs(path) {
path, _ = filepath.Rel(string(os.PathSeparator), filepath.Clean(string(os.PathSeparator)+path)) path, _ = filepath.Rel(string(os.PathSeparator), filepath.Clean(string(os.PathSeparator)+path))
} }
return filepath.Clean(path) return path
}
func retryingWriteFile(path string, data []byte, mode os.FileMode) error {
// Retry writes on EINTR; see:
// https://github.com/golang/go/issues/38033
for {
err := ioutil.WriteFile(path, data, mode)
if err == nil {
return nil
} else if !errors.Is(err, syscall.EINTR) {
return err
}
}
} }
...@@ -44,7 +44,3 @@ func IgnoreNotExist(err error) error { ...@@ -44,7 +44,3 @@ func IgnoreNotExist(err error) error {
} }
return err return err
} }
func errPassthrough(err error) error {
return err
}
...@@ -18,26 +18,22 @@ package v2 ...@@ -18,26 +18,22 @@ package v2
import ( import (
"bufio" "bufio"
"fmt"
"io/ioutil" "io/ioutil"
"math" "math"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"
"strings" "strings"
"sync"
"syscall" "syscall"
"time" "time"
"golang.org/x/sys/unix"
"github.com/containerd/cgroups/v2/stats" "github.com/containerd/cgroups/v2/stats"
systemdDbus "github.com/coreos/go-systemd/v22/dbus"
"github.com/godbus/dbus/v5" "github.com/godbus/dbus/v5"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
systemdDbus "github.com/coreos/go-systemd/v22/dbus"
) )
const ( const (
...@@ -49,13 +45,8 @@ const ( ...@@ -49,13 +45,8 @@ const (
var ( var (
canDelegate bool canDelegate bool
once sync.Once
) )
type cgValuer interface {
Values() []Value
}
type Event struct { type Event struct {
Low uint64 Low uint64
High uint64 High uint64
...@@ -149,11 +140,21 @@ func (c *Value) write(path string, perm os.FileMode) error { ...@@ -149,11 +140,21 @@ func (c *Value) write(path string, perm os.FileMode) error {
default: default:
return ErrInvalidFormat return ErrInvalidFormat
} }
return ioutil.WriteFile(
filepath.Join(path, c.filename), // Retry writes on EINTR; see:
data, // https://github.com/golang/go/issues/38033
perm, for {
) err := ioutil.WriteFile(
filepath.Join(path, c.filename),
data,
perm,
)
if err == nil {
return nil
} else if !errors.Is(err, syscall.EINTR) {
return err
}
}
} }
func writeValues(path string, values []Value) error { func writeValues(path string, values []Value) error {
...@@ -259,7 +260,7 @@ func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) er ...@@ -259,7 +260,7 @@ func (c *Manager) ToggleControllers(controllers []string, t ControllerToggle) er
// Note that /sys/fs/cgroup/foo/bar/baz/cgroup.subtree_control does not need to be written. // Note that /sys/fs/cgroup/foo/bar/baz/cgroup.subtree_control does not need to be written.
split := strings.Split(c.path, "/") split := strings.Split(c.path, "/")
var lastErr error var lastErr error
for i, _ := range split { for i := range split {
f := strings.Join(split[:i], "/") f := strings.Join(split[:i], "/")
if !strings.HasPrefix(f, c.unifiedMountpoint) || f == c.path { if !strings.HasPrefix(f, c.unifiedMountpoint) || f == c.path {
continue continue
...@@ -362,8 +363,7 @@ func (c *Manager) Stat() (*stats.Metrics, error) { ...@@ -362,8 +363,7 @@ func (c *Manager) Stat() (*stats.Metrics, error) {
for _, controller := range controllers { for _, controller := range controllers {
switch controller { switch controller {
case "cpu", "memory": case "cpu", "memory":
filename := fmt.Sprintf("%s.stat", controller) if err := readKVStatsFile(c.path, controller+".stat", out); err != nil {
if err := readKVStatsFile(c.path, filename, out); err != nil {
if os.IsNotExist(err) { if os.IsNotExist(err) {
continue continue
} }
...@@ -670,7 +670,7 @@ func NewSystemd(slice, group string, pid int, resources *Resources) (*Manager, e ...@@ -670,7 +670,7 @@ func NewSystemd(slice, group string, pid int, resources *Resources) (*Manager, e
defer conn.Close() defer conn.Close()
properties := []systemdDbus.Property{ properties := []systemdDbus.Property{
systemdDbus.PropDescription(fmt.Sprintf("cgroup %s", group)), systemdDbus.PropDescription("cgroup " + group),
newSystemdProperty("DefaultDependencies", false), newSystemdProperty("DefaultDependencies", false),
newSystemdProperty("MemoryAccounting", true), newSystemdProperty("MemoryAccounting", true),
newSystemdProperty("CPUAccounting", true), newSystemdProperty("CPUAccounting", true),
......
...@@ -29,7 +29,7 @@ func NestedGroupPath(suffix string) (string, error) { ...@@ -29,7 +29,7 @@ func NestedGroupPath(suffix string) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
return filepath.Join(string(path), suffix), nil return filepath.Join(path, suffix), nil
} }
// PidGroupPath will return the correct cgroup paths for an existing process running inside a cgroup // PidGroupPath will return the correct cgroup paths for an existing process running inside a cgroup
......
...@@ -28,9 +28,8 @@ import ( ...@@ -28,9 +28,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/godbus/dbus/v5"
"github.com/containerd/cgroups/v2/stats" "github.com/containerd/cgroups/v2/stats"
"github.com/godbus/dbus/v5"
"github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
...@@ -106,14 +105,6 @@ func parseKV(raw string) (string, interface{}, error) { ...@@ -106,14 +105,6 @@ func parseKV(raw string) (string, interface{}, error) {
} }
} }
func readUint(path string) (uint64, error) {
v, err := ioutil.ReadFile(path)
if err != nil {
return 0, err
}
return parseUint(strings.TrimSpace(string(v)), 10, 64)
}
func parseUint(s string, base, bitSize int) (uint64, error) { func parseUint(s string, base, bitSize int) (uint64, error) {
v, err := strconv.ParseUint(s, base, bitSize) v, err := strconv.ParseUint(s, base, bitSize)
if err != nil { if err != nil {
...@@ -178,7 +169,7 @@ func ToResources(spec *specs.LinuxResources) *Resources { ...@@ -178,7 +169,7 @@ func ToResources(spec *specs.LinuxResources) *Resources {
Mems: cpu.Mems, Mems: cpu.Mems,
} }
if shares := cpu.Shares; shares != nil { if shares := cpu.Shares; shares != nil {
convertedWeight := (1 + ((*shares-2)*9999)/262142) convertedWeight := 1 + ((*shares-2)*9999)/262142
resources.CPU.Weight = &convertedWeight resources.CPU.Weight = &convertedWeight
} }
if period := cpu.Period; period != nil { if period := cpu.Period; period != nil {
...@@ -301,8 +292,8 @@ func readIoStats(path string) []*stats.IOEntry { ...@@ -301,8 +292,8 @@ func readIoStats(path string) []*stats.IOEntry {
Major: major, Major: major,
Minor: minor, Minor: minor,
} }
for _, stats := range parts { for _, s := range parts {
keyPairValue := strings.Split(stats, "=") keyPairValue := strings.Split(s, "=")
if len(keyPairValue) != 2 { if len(keyPairValue) != 2 {
continue continue
} }
......
language: go language: go
go: go:
- "1.10.x" - "1.12.x"
- "1.11.x" - "1.13.x"
go_import_path: github.com/containerd/console go_import_path: github.com/containerd/console
env:
- GO111MODULE=on
install: install:
- go get -d - pushd ..; go get -u github.com/vbatts/git-validation; popd
- GOOS=openbsd go get -d - pushd ..; go get -u github.com/kunalkushwaha/ltag; popd
- GOOS=solaris go get -d
- GOOS=windows go get -d
- go get -u github.com/vbatts/git-validation
- go get -u github.com/kunalkushwaha/ltag
before_script: before_script:
- pushd ..; git clone https://github.com/containerd/project; popd - pushd ..; git clone https://github.com/containerd/project; popd
...@@ -19,6 +18,7 @@ before_script: ...@@ -19,6 +18,7 @@ before_script:
script: script:
- DCO_VERBOSITY=-q ../project/script/validate/dco - DCO_VERBOSITY=-q ../project/script/validate/dco
- ../project/script/validate/fileheader ../project/ - ../project/script/validate/fileheader ../project/
- travis_wait ../project/script/validate/vendor
- go test -race - go test -race
- GOOS=openbsd go build - GOOS=openbsd go build
- GOOS=openbsd go test -c - GOOS=openbsd go test -c
......
...@@ -24,10 +24,17 @@ import ( ...@@ -24,10 +24,17 @@ import (
var ErrNotAConsole = errors.New("provided file is not a console") var ErrNotAConsole = errors.New("provided file is not a console")
type File interface {
io.ReadWriteCloser
// Fd returns its file descriptor
Fd() uintptr
// Name returns its file name
Name() string
}
type Console interface { type Console interface {
io.Reader File
io.Writer
io.Closer
// Resize resizes the console to the provided window size // Resize resizes the console to the provided window size
Resize(WinSize) error Resize(WinSize) error
...@@ -42,10 +49,6 @@ type Console interface { ...@@ -42,10 +49,6 @@ type Console interface {
Reset() error Reset() error
// Size returns the window size of the console // Size returns the window size of the console
Size() (WinSize, error) Size() (WinSize, error)
// Fd returns the console's file descriptor
Fd() uintptr
// Name returns the console's file name
Name() string
} }
// WinSize specifies the window size of the console // WinSize specifies the window size of the console
...@@ -70,7 +73,7 @@ func Current() Console { ...@@ -70,7 +73,7 @@ func Current() Console {
} }
// ConsoleFromFile returns a console using the provided file // ConsoleFromFile returns a console using the provided file
func ConsoleFromFile(f *os.File) (Console, error) { func ConsoleFromFile(f File) (Console, error) {
if err := checkConsole(f); err != nil { if err := checkConsole(f); err != nil {
return nil, err return nil, err
} }
......
...@@ -58,6 +58,7 @@ type Epoller struct { ...@@ -58,6 +58,7 @@ type Epoller struct {
efd int efd int
mu sync.Mutex mu sync.Mutex
fdMapping map[int]*EpollConsole fdMapping map[int]*EpollConsole
closeOnce sync.Once
} }
// NewEpoller returns an instance of epoller with a valid epoll fd. // NewEpoller returns an instance of epoller with a valid epoll fd.
...@@ -151,7 +152,11 @@ func (e *Epoller) getConsole(sysfd int) *EpollConsole { ...@@ -151,7 +152,11 @@ func (e *Epoller) getConsole(sysfd int) *EpollConsole {
// Close closes the epoll fd // Close closes the epoll fd
func (e *Epoller) Close() error { func (e *Epoller) Close() error {
return unix.Close(e.efd) closeErr := os.ErrClosed // default to "file already closed"
e.closeOnce.Do(func() {
closeErr = unix.Close(e.efd)
})
return closeErr
} }
// EpollConsole acts like a console but registers its file descriptor with an // EpollConsole acts like a console but registers its file descriptor with an
......
...@@ -47,7 +47,7 @@ func NewPty() (Console, string, error) { ...@@ -47,7 +47,7 @@ func NewPty() (Console, string, error) {
} }
type master struct { type master struct {
f *os.File f File
original *unix.Termios original *unix.Termios
} }
...@@ -122,7 +122,7 @@ func (m *master) Name() string { ...@@ -122,7 +122,7 @@ func (m *master) Name() string {
} }
// checkConsole checks if the provided file is a console // checkConsole checks if the provided file is a console
func checkConsole(f *os.File) error { func checkConsole(f File) error {
var termios unix.Termios var termios unix.Termios
if tcget(f.Fd(), &termios) != nil { if tcget(f.Fd(), &termios) != nil {
return ErrNotAConsole return ErrNotAConsole
...@@ -130,7 +130,7 @@ func checkConsole(f *os.File) error { ...@@ -130,7 +130,7 @@ func checkConsole(f *os.File) error {
return nil return nil
} }
func newMaster(f *os.File) (Console, error) { func newMaster(f File) (Console, error) {
m := &master{ m := &master{
f: f, f: f,
} }
......
...@@ -198,7 +198,7 @@ func makeInputRaw(fd windows.Handle, mode uint32) error { ...@@ -198,7 +198,7 @@ func makeInputRaw(fd windows.Handle, mode uint32) error {
return nil return nil
} }
func checkConsole(f *os.File) error { func checkConsole(f File) error {
var mode uint32 var mode uint32
if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil { if err := windows.GetConsoleMode(windows.Handle(f.Fd()), &mode); err != nil {
return err return err
...@@ -206,7 +206,7 @@ func checkConsole(f *os.File) error { ...@@ -206,7 +206,7 @@ func checkConsole(f *os.File) error {
return nil return nil
} }
func newMaster(f *os.File) (Console, error) { func newMaster(f File) (Console, error) {
if f != os.Stdin && f != os.Stdout && f != os.Stderr { if f != os.Stdin && f != os.Stdout && f != os.Stderr {
return nil, errors.New("creating a console from a file is not supported on windows") return nil, errors.New("creating a console from a file is not supported on windows")
} }
......
module github.com/containerd/console
go 1.13
require (
github.com/pkg/errors v0.8.1
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e
)
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
...@@ -97,6 +97,7 @@ Yue Zhang <zy675793960@yeah.net> ...@@ -97,6 +97,7 @@ Yue Zhang <zy675793960@yeah.net>
Yuxing Liu <starnop@163.com> Yuxing Liu <starnop@163.com>
Zhang Wei <zhangwei555@huawei.com> Zhang Wei <zhangwei555@huawei.com>
Zhenguang Zhu <zhengguang.zhu@daocloud.io> Zhenguang Zhu <zhengguang.zhu@daocloud.io>
Zhiyu Li <payall4u@qq.com>
Zhiyu Li <payall4u@qq.com> <404977848@qq.com> Zhiyu Li <payall4u@qq.com> <404977848@qq.com>
Zhongming Chang<zhongming.chang@daocloud.io> Zhongming Chang<zhongming.chang@daocloud.io>
Zhoulin Xie <zhoulin.xie@daocloud.io> Zhoulin Xie <zhoulin.xie@daocloud.io>
......
...@@ -15,7 +15,7 @@ os: ...@@ -15,7 +15,7 @@ os:
- linux - linux
go: go:
- "1.15.5" - "1.15.8"
env: env:
- TRAVIS_GOOS=linux TEST_RUNTIME=io.containerd.runc.v1 TRAVIS_CGO_ENABLED=1 TRAVIS_DISTRO=bionic GOPROXY=direct - TRAVIS_GOOS=linux TEST_RUNTIME=io.containerd.runc.v1 TRAVIS_CGO_ENABLED=1 TRAVIS_DISTRO=bionic GOPROXY=direct
......
...@@ -77,7 +77,7 @@ Vagrant.configure("2") do |config| ...@@ -77,7 +77,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "install-golang", type: "shell", run: "once" do |sh| config.vm.provision "install-golang", type: "shell", run: "once" do |sh|
sh.upload_path = "/tmp/vagrant-install-golang" sh.upload_path = "/tmp/vagrant-install-golang"
sh.env = { sh.env = {
'GO_VERSION': ENV['GO_VERSION'] || "1.15.5", 'GO_VERSION': ENV['GO_VERSION'] || "1.15.8",
} }
sh.inline = <<~SHELL sh.inline = <<~SHELL
#!/usr/bin/env bash #!/usr/bin/env bash
......
...@@ -835,10 +835,7 @@ func (m *ContainerCreate) Unmarshal(dAtA []byte) error { ...@@ -835,10 +835,7 @@ func (m *ContainerCreate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainer
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainer return ErrInvalidLengthContainer
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -957,10 +954,7 @@ func (m *ContainerCreate_Runtime) Unmarshal(dAtA []byte) error { ...@@ -957,10 +954,7 @@ func (m *ContainerCreate_Runtime) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainer
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainer return ErrInvalidLengthContainer
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1185,7 +1179,7 @@ func (m *ContainerUpdate) Unmarshal(dAtA []byte) error { ...@@ -1185,7 +1179,7 @@ func (m *ContainerUpdate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainer return ErrInvalidLengthContainer
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1234,10 +1228,7 @@ func (m *ContainerUpdate) Unmarshal(dAtA []byte) error { ...@@ -1234,10 +1228,7 @@ func (m *ContainerUpdate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainer
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainer return ErrInvalidLengthContainer
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1320,10 +1311,7 @@ func (m *ContainerDelete) Unmarshal(dAtA []byte) error { ...@@ -1320,10 +1311,7 @@ func (m *ContainerDelete) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainer
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainer return ErrInvalidLengthContainer
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -257,10 +257,7 @@ func (m *ContentDelete) Unmarshal(dAtA []byte) error { ...@@ -257,10 +257,7 @@ func (m *ContentDelete) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -697,7 +697,7 @@ func (m *ImageCreate) Unmarshal(dAtA []byte) error { ...@@ -697,7 +697,7 @@ func (m *ImageCreate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImage return ErrInvalidLengthImage
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -714,10 +714,7 @@ func (m *ImageCreate) Unmarshal(dAtA []byte) error { ...@@ -714,10 +714,7 @@ func (m *ImageCreate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImage
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImage return ErrInvalidLengthImage
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -910,7 +907,7 @@ func (m *ImageUpdate) Unmarshal(dAtA []byte) error { ...@@ -910,7 +907,7 @@ func (m *ImageUpdate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImage return ErrInvalidLengthImage
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -927,10 +924,7 @@ func (m *ImageUpdate) Unmarshal(dAtA []byte) error { ...@@ -927,10 +924,7 @@ func (m *ImageUpdate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImage
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImage return ErrInvalidLengthImage
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1013,10 +1007,7 @@ func (m *ImageDelete) Unmarshal(dAtA []byte) error { ...@@ -1013,10 +1007,7 @@ func (m *ImageDelete) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImage
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImage return ErrInvalidLengthImage
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -697,7 +697,7 @@ func (m *NamespaceCreate) Unmarshal(dAtA []byte) error { ...@@ -697,7 +697,7 @@ func (m *NamespaceCreate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -714,10 +714,7 @@ func (m *NamespaceCreate) Unmarshal(dAtA []byte) error { ...@@ -714,10 +714,7 @@ func (m *NamespaceCreate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -910,7 +907,7 @@ func (m *NamespaceUpdate) Unmarshal(dAtA []byte) error { ...@@ -910,7 +907,7 @@ func (m *NamespaceUpdate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -927,10 +924,7 @@ func (m *NamespaceUpdate) Unmarshal(dAtA []byte) error { ...@@ -927,10 +924,7 @@ func (m *NamespaceUpdate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1013,10 +1007,7 @@ func (m *NamespaceDelete) Unmarshal(dAtA []byte) error { ...@@ -1013,10 +1007,7 @@ func (m *NamespaceDelete) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -548,10 +548,7 @@ func (m *SnapshotPrepare) Unmarshal(dAtA []byte) error { ...@@ -548,10 +548,7 @@ func (m *SnapshotPrepare) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshot
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshot return ErrInvalidLengthSnapshot
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -666,10 +663,7 @@ func (m *SnapshotCommit) Unmarshal(dAtA []byte) error { ...@@ -666,10 +663,7 @@ func (m *SnapshotCommit) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshot
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshot return ErrInvalidLengthSnapshot
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -752,10 +746,7 @@ func (m *SnapshotRemove) Unmarshal(dAtA []byte) error { ...@@ -752,10 +746,7 @@ func (m *SnapshotRemove) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshot
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshot return ErrInvalidLengthSnapshot
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -1905,10 +1905,7 @@ func (m *TaskCreate) Unmarshal(dAtA []byte) error { ...@@ -1905,10 +1905,7 @@ func (m *TaskCreate) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2010,10 +2007,7 @@ func (m *TaskStart) Unmarshal(dAtA []byte) error { ...@@ -2010,10 +2007,7 @@ func (m *TaskStart) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2199,10 +2193,7 @@ func (m *TaskDelete) Unmarshal(dAtA []byte) error { ...@@ -2199,10 +2193,7 @@ func (m *TaskDelete) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2369,10 +2360,7 @@ func (m *TaskIO) Unmarshal(dAtA []byte) error { ...@@ -2369,10 +2360,7 @@ func (m *TaskIO) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2558,10 +2546,7 @@ func (m *TaskExit) Unmarshal(dAtA []byte) error { ...@@ -2558,10 +2546,7 @@ func (m *TaskExit) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2644,10 +2629,7 @@ func (m *TaskOOM) Unmarshal(dAtA []byte) error { ...@@ -2644,10 +2629,7 @@ func (m *TaskOOM) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2762,10 +2744,7 @@ func (m *TaskExecAdded) Unmarshal(dAtA []byte) error { ...@@ -2762,10 +2744,7 @@ func (m *TaskExecAdded) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2899,10 +2878,7 @@ func (m *TaskExecStarted) Unmarshal(dAtA []byte) error { ...@@ -2899,10 +2878,7 @@ func (m *TaskExecStarted) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2985,10 +2961,7 @@ func (m *TaskPaused) Unmarshal(dAtA []byte) error { ...@@ -2985,10 +2961,7 @@ func (m *TaskPaused) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3071,10 +3044,7 @@ func (m *TaskResumed) Unmarshal(dAtA []byte) error { ...@@ -3071,10 +3044,7 @@ func (m *TaskResumed) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3189,10 +3159,7 @@ func (m *TaskCheckpointed) Unmarshal(dAtA []byte) error { ...@@ -3189,10 +3159,7 @@ func (m *TaskCheckpointed) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -2106,7 +2106,7 @@ func (m *Container) Unmarshal(dAtA []byte) error { ...@@ -2106,7 +2106,7 @@ func (m *Container) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -2469,7 +2469,7 @@ func (m *Container) Unmarshal(dAtA []byte) error { ...@@ -2469,7 +2469,7 @@ func (m *Container) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -2486,10 +2486,7 @@ func (m *Container) Unmarshal(dAtA []byte) error { ...@@ -2486,10 +2486,7 @@ func (m *Container) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2608,10 +2605,7 @@ func (m *Container_Runtime) Unmarshal(dAtA []byte) error { ...@@ -2608,10 +2605,7 @@ func (m *Container_Runtime) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2694,10 +2688,7 @@ func (m *GetContainerRequest) Unmarshal(dAtA []byte) error { ...@@ -2694,10 +2688,7 @@ func (m *GetContainerRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2781,10 +2772,7 @@ func (m *GetContainerResponse) Unmarshal(dAtA []byte) error { ...@@ -2781,10 +2772,7 @@ func (m *GetContainerResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2867,10 +2855,7 @@ func (m *ListContainersRequest) Unmarshal(dAtA []byte) error { ...@@ -2867,10 +2855,7 @@ func (m *ListContainersRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2955,10 +2940,7 @@ func (m *ListContainersResponse) Unmarshal(dAtA []byte) error { ...@@ -2955,10 +2940,7 @@ func (m *ListContainersResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3042,10 +3024,7 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error { ...@@ -3042,10 +3024,7 @@ func (m *CreateContainerRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3129,10 +3108,7 @@ func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error { ...@@ -3129,10 +3108,7 @@ func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3252,10 +3228,7 @@ func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error { ...@@ -3252,10 +3228,7 @@ func (m *UpdateContainerRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3339,10 +3312,7 @@ func (m *UpdateContainerResponse) Unmarshal(dAtA []byte) error { ...@@ -3339,10 +3312,7 @@ func (m *UpdateContainerResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3425,10 +3395,7 @@ func (m *DeleteContainerRequest) Unmarshal(dAtA []byte) error { ...@@ -3425,10 +3395,7 @@ func (m *DeleteContainerRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3515,10 +3482,7 @@ func (m *ListContainerMessage) Unmarshal(dAtA []byte) error { ...@@ -3515,10 +3482,7 @@ func (m *ListContainerMessage) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContainers
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContainers return ErrInvalidLengthContainers
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -3280,7 +3280,7 @@ func (m *Info) Unmarshal(dAtA []byte) error { ...@@ -3280,7 +3280,7 @@ func (m *Info) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -3297,10 +3297,7 @@ func (m *Info) Unmarshal(dAtA []byte) error { ...@@ -3297,10 +3297,7 @@ func (m *Info) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3383,10 +3380,7 @@ func (m *InfoRequest) Unmarshal(dAtA []byte) error { ...@@ -3383,10 +3380,7 @@ func (m *InfoRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3470,10 +3464,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error { ...@@ -3470,10 +3464,7 @@ func (m *InfoResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3593,10 +3584,7 @@ func (m *UpdateRequest) Unmarshal(dAtA []byte) error { ...@@ -3593,10 +3584,7 @@ func (m *UpdateRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3680,10 +3668,7 @@ func (m *UpdateResponse) Unmarshal(dAtA []byte) error { ...@@ -3680,10 +3668,7 @@ func (m *UpdateResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3766,10 +3751,7 @@ func (m *ListContentRequest) Unmarshal(dAtA []byte) error { ...@@ -3766,10 +3751,7 @@ func (m *ListContentRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3854,10 +3836,7 @@ func (m *ListContentResponse) Unmarshal(dAtA []byte) error { ...@@ -3854,10 +3836,7 @@ func (m *ListContentResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3940,10 +3919,7 @@ func (m *DeleteContentRequest) Unmarshal(dAtA []byte) error { ...@@ -3940,10 +3919,7 @@ func (m *DeleteContentRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4064,10 +4040,7 @@ func (m *ReadContentRequest) Unmarshal(dAtA []byte) error { ...@@ -4064,10 +4040,7 @@ func (m *ReadContentRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4171,10 +4144,7 @@ func (m *ReadContentResponse) Unmarshal(dAtA []byte) error { ...@@ -4171,10 +4144,7 @@ func (m *ReadContentResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4393,10 +4363,7 @@ func (m *Status) Unmarshal(dAtA []byte) error { ...@@ -4393,10 +4363,7 @@ func (m *Status) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4479,10 +4446,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error { ...@@ -4479,10 +4446,7 @@ func (m *StatusRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4569,10 +4533,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error { ...@@ -4569,10 +4533,7 @@ func (m *StatusResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4655,10 +4616,7 @@ func (m *ListStatusesRequest) Unmarshal(dAtA []byte) error { ...@@ -4655,10 +4616,7 @@ func (m *ListStatusesRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4743,10 +4701,7 @@ func (m *ListStatusesResponse) Unmarshal(dAtA []byte) error { ...@@ -4743,10 +4701,7 @@ func (m *ListStatusesResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5062,7 +5017,7 @@ func (m *WriteContentRequest) Unmarshal(dAtA []byte) error { ...@@ -5062,7 +5017,7 @@ func (m *WriteContentRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -5079,10 +5034,7 @@ func (m *WriteContentRequest) Unmarshal(dAtA []byte) error { ...@@ -5079,10 +5034,7 @@ func (m *WriteContentRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5288,10 +5240,7 @@ func (m *WriteContentResponse) Unmarshal(dAtA []byte) error { ...@@ -5288,10 +5240,7 @@ func (m *WriteContentResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5374,10 +5323,7 @@ func (m *AbortRequest) Unmarshal(dAtA []byte) error { ...@@ -5374,10 +5323,7 @@ func (m *AbortRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthContent
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthContent return ErrInvalidLengthContent
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -1063,7 +1063,7 @@ func (m *ApplyRequest) Unmarshal(dAtA []byte) error { ...@@ -1063,7 +1063,7 @@ func (m *ApplyRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDiff return ErrInvalidLengthDiff
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1080,10 +1080,7 @@ func (m *ApplyRequest) Unmarshal(dAtA []byte) error { ...@@ -1080,10 +1080,7 @@ func (m *ApplyRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDiff
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDiff return ErrInvalidLengthDiff
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1170,10 +1167,7 @@ func (m *ApplyResponse) Unmarshal(dAtA []byte) error { ...@@ -1170,10 +1167,7 @@ func (m *ApplyResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDiff
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDiff return ErrInvalidLengthDiff
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1466,7 +1460,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error { ...@@ -1466,7 +1460,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDiff return ErrInvalidLengthDiff
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1483,10 +1477,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error { ...@@ -1483,10 +1477,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDiff
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDiff return ErrInvalidLengthDiff
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1573,10 +1564,7 @@ func (m *DiffResponse) Unmarshal(dAtA []byte) error { ...@@ -1573,10 +1564,7 @@ func (m *DiffResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDiff
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDiff return ErrInvalidLengthDiff
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -916,10 +916,7 @@ func (m *PublishRequest) Unmarshal(dAtA []byte) error { ...@@ -916,10 +916,7 @@ func (m *PublishRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents return ErrInvalidLengthEvents
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1006,10 +1003,7 @@ func (m *ForwardRequest) Unmarshal(dAtA []byte) error { ...@@ -1006,10 +1003,7 @@ func (m *ForwardRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents return ErrInvalidLengthEvents
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1092,10 +1086,7 @@ func (m *SubscribeRequest) Unmarshal(dAtA []byte) error { ...@@ -1092,10 +1086,7 @@ func (m *SubscribeRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents return ErrInvalidLengthEvents
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1279,10 +1270,7 @@ func (m *Envelope) Unmarshal(dAtA []byte) error { ...@@ -1279,10 +1270,7 @@ func (m *Envelope) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents return ErrInvalidLengthEvents
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -1707,7 +1707,7 @@ func (m *Image) Unmarshal(dAtA []byte) error { ...@@ -1707,7 +1707,7 @@ func (m *Image) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1823,10 +1823,7 @@ func (m *Image) Unmarshal(dAtA []byte) error { ...@@ -1823,10 +1823,7 @@ func (m *Image) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1909,10 +1906,7 @@ func (m *GetImageRequest) Unmarshal(dAtA []byte) error { ...@@ -1909,10 +1906,7 @@ func (m *GetImageRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1999,10 +1993,7 @@ func (m *GetImageResponse) Unmarshal(dAtA []byte) error { ...@@ -1999,10 +1993,7 @@ func (m *GetImageResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2086,10 +2077,7 @@ func (m *CreateImageRequest) Unmarshal(dAtA []byte) error { ...@@ -2086,10 +2077,7 @@ func (m *CreateImageRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2173,10 +2161,7 @@ func (m *CreateImageResponse) Unmarshal(dAtA []byte) error { ...@@ -2173,10 +2161,7 @@ func (m *CreateImageResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2296,10 +2281,7 @@ func (m *UpdateImageRequest) Unmarshal(dAtA []byte) error { ...@@ -2296,10 +2281,7 @@ func (m *UpdateImageRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2383,10 +2365,7 @@ func (m *UpdateImageResponse) Unmarshal(dAtA []byte) error { ...@@ -2383,10 +2365,7 @@ func (m *UpdateImageResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2469,10 +2448,7 @@ func (m *ListImagesRequest) Unmarshal(dAtA []byte) error { ...@@ -2469,10 +2448,7 @@ func (m *ListImagesRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2557,10 +2533,7 @@ func (m *ListImagesResponse) Unmarshal(dAtA []byte) error { ...@@ -2557,10 +2533,7 @@ func (m *ListImagesResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2663,10 +2636,7 @@ func (m *DeleteImageRequest) Unmarshal(dAtA []byte) error { ...@@ -2663,10 +2636,7 @@ func (m *DeleteImageRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthImages
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthImages return ErrInvalidLengthImages
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -1098,7 +1098,7 @@ func (m *Plugin) Unmarshal(dAtA []byte) error { ...@@ -1098,7 +1098,7 @@ func (m *Plugin) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIntrospection return ErrInvalidLengthIntrospection
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1183,10 +1183,7 @@ func (m *Plugin) Unmarshal(dAtA []byte) error { ...@@ -1183,10 +1183,7 @@ func (m *Plugin) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIntrospection
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthIntrospection return ErrInvalidLengthIntrospection
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1269,10 +1266,7 @@ func (m *PluginsRequest) Unmarshal(dAtA []byte) error { ...@@ -1269,10 +1266,7 @@ func (m *PluginsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIntrospection
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthIntrospection return ErrInvalidLengthIntrospection
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1357,10 +1351,7 @@ func (m *PluginsResponse) Unmarshal(dAtA []byte) error { ...@@ -1357,10 +1351,7 @@ func (m *PluginsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIntrospection
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthIntrospection return ErrInvalidLengthIntrospection
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1443,10 +1434,7 @@ func (m *ServerResponse) Unmarshal(dAtA []byte) error { ...@@ -1443,10 +1434,7 @@ func (m *ServerResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthIntrospection
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthIntrospection return ErrInvalidLengthIntrospection
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -1906,7 +1906,7 @@ func (m *Lease) Unmarshal(dAtA []byte) error { ...@@ -1906,7 +1906,7 @@ func (m *Lease) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1923,10 +1923,7 @@ func (m *Lease) Unmarshal(dAtA []byte) error { ...@@ -1923,10 +1923,7 @@ func (m *Lease) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2119,7 +2116,7 @@ func (m *CreateRequest) Unmarshal(dAtA []byte) error { ...@@ -2119,7 +2116,7 @@ func (m *CreateRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -2136,10 +2133,7 @@ func (m *CreateRequest) Unmarshal(dAtA []byte) error { ...@@ -2136,10 +2133,7 @@ func (m *CreateRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2226,10 +2220,7 @@ func (m *CreateResponse) Unmarshal(dAtA []byte) error { ...@@ -2226,10 +2220,7 @@ func (m *CreateResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2332,10 +2323,7 @@ func (m *DeleteRequest) Unmarshal(dAtA []byte) error { ...@@ -2332,10 +2323,7 @@ func (m *DeleteRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2418,10 +2406,7 @@ func (m *ListRequest) Unmarshal(dAtA []byte) error { ...@@ -2418,10 +2406,7 @@ func (m *ListRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2506,10 +2491,7 @@ func (m *ListResponse) Unmarshal(dAtA []byte) error { ...@@ -2506,10 +2491,7 @@ func (m *ListResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2624,10 +2606,7 @@ func (m *Resource) Unmarshal(dAtA []byte) error { ...@@ -2624,10 +2606,7 @@ func (m *Resource) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2743,10 +2722,7 @@ func (m *AddResourceRequest) Unmarshal(dAtA []byte) error { ...@@ -2743,10 +2722,7 @@ func (m *AddResourceRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2862,10 +2838,7 @@ func (m *DeleteResourceRequest) Unmarshal(dAtA []byte) error { ...@@ -2862,10 +2838,7 @@ func (m *DeleteResourceRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2948,10 +2921,7 @@ func (m *ListResourcesRequest) Unmarshal(dAtA []byte) error { ...@@ -2948,10 +2921,7 @@ func (m *ListResourcesRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3036,10 +3006,7 @@ func (m *ListResourcesResponse) Unmarshal(dAtA []byte) error { ...@@ -3036,10 +3006,7 @@ func (m *ListResourcesResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthLeases
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthLeases return ErrInvalidLengthLeases
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -1609,7 +1609,7 @@ func (m *Namespace) Unmarshal(dAtA []byte) error { ...@@ -1609,7 +1609,7 @@ func (m *Namespace) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -1626,10 +1626,7 @@ func (m *Namespace) Unmarshal(dAtA []byte) error { ...@@ -1626,10 +1626,7 @@ func (m *Namespace) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1712,10 +1709,7 @@ func (m *GetNamespaceRequest) Unmarshal(dAtA []byte) error { ...@@ -1712,10 +1709,7 @@ func (m *GetNamespaceRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1799,10 +1793,7 @@ func (m *GetNamespaceResponse) Unmarshal(dAtA []byte) error { ...@@ -1799,10 +1793,7 @@ func (m *GetNamespaceResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1885,10 +1876,7 @@ func (m *ListNamespacesRequest) Unmarshal(dAtA []byte) error { ...@@ -1885,10 +1876,7 @@ func (m *ListNamespacesRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1973,10 +1961,7 @@ func (m *ListNamespacesResponse) Unmarshal(dAtA []byte) error { ...@@ -1973,10 +1961,7 @@ func (m *ListNamespacesResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2060,10 +2045,7 @@ func (m *CreateNamespaceRequest) Unmarshal(dAtA []byte) error { ...@@ -2060,10 +2045,7 @@ func (m *CreateNamespaceRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2147,10 +2129,7 @@ func (m *CreateNamespaceResponse) Unmarshal(dAtA []byte) error { ...@@ -2147,10 +2129,7 @@ func (m *CreateNamespaceResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2270,10 +2249,7 @@ func (m *UpdateNamespaceRequest) Unmarshal(dAtA []byte) error { ...@@ -2270,10 +2249,7 @@ func (m *UpdateNamespaceRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2357,10 +2333,7 @@ func (m *UpdateNamespaceResponse) Unmarshal(dAtA []byte) error { ...@@ -2357,10 +2333,7 @@ func (m *UpdateNamespaceResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -2443,10 +2416,7 @@ func (m *DeleteNamespaceRequest) Unmarshal(dAtA []byte) error { ...@@ -2443,10 +2416,7 @@ func (m *DeleteNamespaceRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthNamespace
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthNamespace return ErrInvalidLengthNamespace
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -3140,7 +3140,7 @@ func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -3140,7 +3140,7 @@ func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -3157,10 +3157,7 @@ func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -3157,10 +3157,7 @@ func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3245,10 +3242,7 @@ func (m *PrepareSnapshotResponse) Unmarshal(dAtA []byte) error { ...@@ -3245,10 +3242,7 @@ func (m *PrepareSnapshotResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3505,7 +3499,7 @@ func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -3505,7 +3499,7 @@ func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -3522,10 +3516,7 @@ func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -3522,10 +3516,7 @@ func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3610,10 +3601,7 @@ func (m *ViewSnapshotResponse) Unmarshal(dAtA []byte) error { ...@@ -3610,10 +3601,7 @@ func (m *ViewSnapshotResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3728,10 +3716,7 @@ func (m *MountsRequest) Unmarshal(dAtA []byte) error { ...@@ -3728,10 +3716,7 @@ func (m *MountsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3816,10 +3801,7 @@ func (m *MountsResponse) Unmarshal(dAtA []byte) error { ...@@ -3816,10 +3801,7 @@ func (m *MountsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3934,10 +3916,7 @@ func (m *RemoveSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -3934,10 +3916,7 @@ func (m *RemoveSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4194,7 +4173,7 @@ func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -4194,7 +4173,7 @@ func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -4211,10 +4190,7 @@ func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -4211,10 +4190,7 @@ func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4329,10 +4305,7 @@ func (m *StatSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -4329,10 +4305,7 @@ func (m *StatSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4642,7 +4615,7 @@ func (m *Info) Unmarshal(dAtA []byte) error { ...@@ -4642,7 +4615,7 @@ func (m *Info) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -4659,10 +4632,7 @@ func (m *Info) Unmarshal(dAtA []byte) error { ...@@ -4659,10 +4632,7 @@ func (m *Info) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4746,10 +4716,7 @@ func (m *StatSnapshotResponse) Unmarshal(dAtA []byte) error { ...@@ -4746,10 +4716,7 @@ func (m *StatSnapshotResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4901,10 +4868,7 @@ func (m *UpdateSnapshotRequest) Unmarshal(dAtA []byte) error { ...@@ -4901,10 +4868,7 @@ func (m *UpdateSnapshotRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4988,10 +4952,7 @@ func (m *UpdateSnapshotResponse) Unmarshal(dAtA []byte) error { ...@@ -4988,10 +4952,7 @@ func (m *UpdateSnapshotResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5106,10 +5067,7 @@ func (m *ListSnapshotsRequest) Unmarshal(dAtA []byte) error { ...@@ -5106,10 +5067,7 @@ func (m *ListSnapshotsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5194,10 +5152,7 @@ func (m *ListSnapshotsResponse) Unmarshal(dAtA []byte) error { ...@@ -5194,10 +5152,7 @@ func (m *ListSnapshotsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5312,10 +5267,7 @@ func (m *UsageRequest) Unmarshal(dAtA []byte) error { ...@@ -5312,10 +5267,7 @@ func (m *UsageRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5404,10 +5356,7 @@ func (m *UsageResponse) Unmarshal(dAtA []byte) error { ...@@ -5404,10 +5356,7 @@ func (m *UsageResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5490,10 +5439,7 @@ func (m *CleanupRequest) Unmarshal(dAtA []byte) error { ...@@ -5490,10 +5439,7 @@ func (m *CleanupRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthSnapshots
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthSnapshots return ErrInvalidLengthSnapshots
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -4347,10 +4347,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -4347,10 +4347,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4452,10 +4449,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error { ...@@ -4452,10 +4449,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4570,10 +4564,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error { ...@@ -4570,10 +4564,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4643,10 +4634,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error { ...@@ -4643,10 +4634,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4729,10 +4717,7 @@ func (m *DeleteTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -4729,10 +4717,7 @@ func (m *DeleteTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4886,10 +4871,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error { ...@@ -4886,10 +4871,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5004,10 +4986,7 @@ func (m *DeleteProcessRequest) Unmarshal(dAtA []byte) error { ...@@ -5004,10 +4986,7 @@ func (m *DeleteProcessRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5122,10 +5101,7 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error { ...@@ -5122,10 +5101,7 @@ func (m *GetRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5212,10 +5188,7 @@ func (m *GetResponse) Unmarshal(dAtA []byte) error { ...@@ -5212,10 +5188,7 @@ func (m *GetResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5298,10 +5271,7 @@ func (m *ListTasksRequest) Unmarshal(dAtA []byte) error { ...@@ -5298,10 +5271,7 @@ func (m *ListTasksRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5386,10 +5356,7 @@ func (m *ListTasksResponse) Unmarshal(dAtA []byte) error { ...@@ -5386,10 +5356,7 @@ func (m *ListTasksResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5543,10 +5510,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { ...@@ -5543,10 +5510,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5813,10 +5777,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { ...@@ -5813,10 +5777,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5867,10 +5828,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { ...@@ -5867,10 +5828,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6023,10 +5981,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error { ...@@ -6023,10 +5981,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6161,10 +6116,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error { ...@@ -6161,10 +6116,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6247,10 +6199,7 @@ func (m *PauseTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -6247,10 +6199,7 @@ func (m *PauseTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6333,10 +6282,7 @@ func (m *ResumeTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -6333,10 +6282,7 @@ func (m *ResumeTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6419,10 +6365,7 @@ func (m *ListPidsRequest) Unmarshal(dAtA []byte) error { ...@@ -6419,10 +6365,7 @@ func (m *ListPidsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6507,10 +6450,7 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error { ...@@ -6507,10 +6450,7 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6661,10 +6601,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -6661,10 +6601,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6749,10 +6686,7 @@ func (m *CheckpointTaskResponse) Unmarshal(dAtA []byte) error { ...@@ -6749,10 +6686,7 @@ func (m *CheckpointTaskResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6871,10 +6805,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -6871,10 +6805,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6957,10 +6888,7 @@ func (m *MetricsRequest) Unmarshal(dAtA []byte) error { ...@@ -6957,10 +6888,7 @@ func (m *MetricsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -7045,10 +6973,7 @@ func (m *MetricsResponse) Unmarshal(dAtA []byte) error { ...@@ -7045,10 +6973,7 @@ func (m *MetricsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -7163,10 +7088,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error { ...@@ -7163,10 +7088,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -7269,10 +7191,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error { ...@@ -7269,10 +7191,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTasks
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTasks return ErrInvalidLengthTasks
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -474,10 +474,7 @@ func (m *ForwardRequest) Unmarshal(dAtA []byte) error { ...@@ -474,10 +474,7 @@ func (m *ForwardRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents return ErrInvalidLengthEvents
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -661,10 +658,7 @@ func (m *Envelope) Unmarshal(dAtA []byte) error { ...@@ -661,10 +658,7 @@ func (m *Envelope) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthEvents return ErrInvalidLengthEvents
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -374,10 +374,7 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error { ...@@ -374,10 +374,7 @@ func (m *VersionResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthVersion
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthVersion return ErrInvalidLengthVersion
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -479,7 +479,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error { ...@@ -479,7 +479,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDescriptor return ErrInvalidLengthDescriptor
} }
if (iNdEx + skippy) > postIndex { if (iNdEx + skippy) > postIndex {
...@@ -496,10 +496,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error { ...@@ -496,10 +496,7 @@ func (m *Descriptor) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthDescriptor
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthDescriptor return ErrInvalidLengthDescriptor
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -348,10 +348,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error { ...@@ -348,10 +348,7 @@ func (m *Metric) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthMetrics
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthMetrics return ErrInvalidLengthMetrics
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -392,10 +392,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error { ...@@ -392,10 +392,7 @@ func (m *Mount) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthMount
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthMount return ErrInvalidLengthMount
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -333,10 +333,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error { ...@@ -333,10 +333,7 @@ func (m *Platform) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthPlatform
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthPlatform return ErrInvalidLengthPlatform
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -772,10 +772,7 @@ func (m *Process) Unmarshal(dAtA []byte) error { ...@@ -772,10 +772,7 @@ func (m *Process) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -881,10 +878,7 @@ func (m *ProcessInfo) Unmarshal(dAtA []byte) error { ...@@ -881,10 +878,7 @@ func (m *ProcessInfo) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthTask return ErrInvalidLengthTask
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -103,7 +103,7 @@ When '--all-platforms' is given all images in a manifest list must be available. ...@@ -103,7 +103,7 @@ When '--all-platforms' is given all images in a manifest list must be available.
} else { } else {
w, err = os.Create(out) w, err = os.Create(out)
if err != nil { if err != nil {
return nil return err
} }
} }
defer w.Close() defer w.Close()
......
...@@ -3,7 +3,8 @@ module github.com/containerd/containerd ...@@ -3,7 +3,8 @@ module github.com/containerd/containerd
go 1.14 go 1.14
replace ( replace (
github.com/containerd/cri => github.com/k3s-io/cri v1.4.0-k3s.2 // k3s-release/1.4 github.com/containerd/continuity => github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1
github.com/containerd/cri => github.com/k3s-io/cri v1.4.0-k3s.5 // k3s-release/1.4
github.com/golang/protobuf => github.com/golang/protobuf v1.3.5 github.com/golang/protobuf => github.com/golang/protobuf v1.3.5
google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63 google.golang.org/genproto => google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63
k8s.io/api => k8s.io/api v0.19.5 k8s.io/api => k8s.io/api v0.19.5
...@@ -71,14 +72,14 @@ require ( ...@@ -71,14 +72,14 @@ require (
github.com/opencontainers/selinux v1.6.0 github.com/opencontainers/selinux v1.6.0
github.com/pkg/errors v0.9.1 github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.7.1 github.com/prometheus/client_golang v1.7.1
github.com/sirupsen/logrus v1.6.0 github.com/sirupsen/logrus v1.7.0
github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2 github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2
github.com/tchap/go-patricia v2.2.6+incompatible // indirect github.com/tchap/go-patricia v2.2.6+incompatible // indirect
github.com/urfave/cli v1.22.2 github.com/urfave/cli v1.22.2
go.etcd.io/bbolt v1.3.5 go.etcd.io/bbolt v1.3.5
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3
google.golang.org/grpc v1.27.1 google.golang.org/grpc v1.27.1
gotest.tools/v3 v3.0.2 gotest.tools/v3 v3.0.2
) )
...@@ -131,10 +131,6 @@ github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go. ...@@ -131,10 +131,6 @@ github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.
github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.2/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
github.com/containerd/containerd v1.3.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.3/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA=
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-20200710164510-efbc4488d8fe h1:PEmIrUvwG9Yyv+0WKZqjXfSFDeZjs/q15g0m08BYS9k=
github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe/go.mod h1:cECdGN1O8G9bgKTlLhuPJimka6Xb/Gg7vYzCTNVxhvo=
github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20180307165137-3d5202aec260/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI= github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv3Kuk8dQz2ZQXpnv/UZZUHUCL7pnLehbXgQI=
github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b h1:qUtCegLdOUVfVJOw+KDg6eJyE1TGvLlkGEd1091kSSQ= github.com/containerd/fifo v0.0.0-20200410184934-f15a3290365b h1:qUtCegLdOUVfVJOw+KDg6eJyE1TGvLlkGEd1091kSSQ=
...@@ -404,8 +400,10 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X ...@@ -404,8 +400,10 @@ github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/X
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes= github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/k3s-io/cri v1.4.0-k3s.2 h1:HiJLH0P7k6sSJwbzjPwIN0CeY0iA6bKlb7OyThMiaEo= github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1 h1:KEz2rd9IDbrQT8w6RibEYlwfTXiu0P6hQDE+6O4IJdI=
github.com/k3s-io/cri v1.4.0-k3s.2/go.mod h1:fGPUUHMKQik/vIegSe05DtX/m4miovdtvVLqRUFAkK0= github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1/go.mod h1:EXlVlkqNba9rJe3j7w3Xa924itAMLgZH4UD/Q4PExuQ=
github.com/k3s-io/cri v1.4.0-k3s.5 h1:Uh7QkRKibPJqSBbtCtgpjYsdNVcx3Tx+7HHlhxKBtu8=
github.com/k3s-io/cri v1.4.0-k3s.5/go.mod h1:fGPUUHMKQik/vIegSe05DtX/m4miovdtvVLqRUFAkK0=
github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/karrick/godirwalk v1.7.5/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
...@@ -486,7 +484,6 @@ github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB ...@@ -486,7 +484,6 @@ github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB
github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw= github.com/onsi/ginkgo v1.11.0 h1:JAKSXpt1YjtLA7YpPiqO9ss6sNXEsPfSGdwN0UHqzrw=
github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
...@@ -527,7 +524,6 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP ...@@ -527,7 +524,6 @@ github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtP
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1-0.20171018195549-f15c970de5b7/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
...@@ -583,13 +579,14 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW ...@@ -583,13 +579,14 @@ github.com/seccomp/libseccomp-golang v0.9.1/go.mod h1:GbW5+tmTXfcxTToHLXlScSlAvW
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.0.4-0.20170822132746-89742aefa4b2/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.0.6/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
...@@ -672,7 +669,6 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= ...@@ -672,7 +669,6 @@ go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20171113213409-9f005a07e0d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181009213950-7c1a557ab941/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190123085648-057139ce5d2b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
...@@ -782,6 +778,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w ...@@ -782,6 +778,7 @@ golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191115151921-52ab43148777/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
...@@ -802,6 +799,8 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w ...@@ -802,6 +799,8 @@ golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd h1:5CtCZbICpIOFdgO940moixOPjc0178IU44m4EjOO5IY=
golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
......
...@@ -136,7 +136,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten ...@@ -136,7 +136,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
// //
// for the private repo, we should remove mount-from // for the private repo, we should remove mount-from
// query and send the request again. // query and send the request again.
resp, err = preq.do(pctx) resp, err = preq.doWithRetries(pctx, nil)
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -235,7 +235,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten ...@@ -235,7 +235,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
go func() { go func() {
defer close(respC) defer close(respC)
resp, err := req.do(ctx) resp, err := req.doWithRetries(ctx, nil)
if err != nil { if err != nil {
pr.CloseWithError(err) pr.CloseWithError(err)
return return
......
...@@ -71,6 +71,7 @@ type RegistryHost struct { ...@@ -71,6 +71,7 @@ type RegistryHost struct {
Path string Path string
Capabilities HostCapabilities Capabilities HostCapabilities
Header http.Header Header http.Header
Rewrites map[string]string
} }
func (h RegistryHost) isProxy(refhost string) bool { func (h RegistryHost) isProxy(refhost string) bool {
......
...@@ -24,6 +24,7 @@ import ( ...@@ -24,6 +24,7 @@ import (
"net/http" "net/http"
"net/url" "net/url"
"path" "path"
"regexp"
"strings" "strings"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
...@@ -462,7 +463,19 @@ func (r *dockerBase) request(host RegistryHost, method string, ps ...string) *re ...@@ -462,7 +463,19 @@ func (r *dockerBase) request(host RegistryHost, method string, ps ...string) *re
for key, value := range host.Header { for key, value := range host.Header {
header[key] = append(header[key], value...) header[key] = append(header[key], value...)
} }
parts := append([]string{"/", host.Path, r.repository}, ps...) repository := r.repository
for pattern, replace := range host.Rewrites {
exp, err := regexp.Compile(pattern)
if err != nil {
logrus.Warnf("failed to compile rewrite, `%s`, for %s", pattern, host.Host)
continue
}
if rr := exp.ReplaceAllString(repository, replace); rr != repository {
repository = rr
break
}
}
parts := append([]string{"/", host.Path, repository}, ps...)
p := path.Join(parts...) p := path.Join(parts...)
// Join strips trailing slash, re-add ending "/" if included // Join strips trailing slash, re-add ending "/" if included
if len(parts) > 0 && strings.HasSuffix(parts[len(parts)-1], "/") { if len(parts) > 0 && strings.HasSuffix(parts[len(parts)-1], "/") {
...@@ -525,7 +538,10 @@ func (r *request) do(ctx context.Context) (*http.Response, error) { ...@@ -525,7 +538,10 @@ func (r *request) do(ctx context.Context) (*http.Response, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
req.Header = r.header req.Header = http.Header{} // headers need to be copied to avoid concurrent map access
for k, v := range r.header {
req.Header[k] = v
}
if r.body != nil { if r.body != nil {
body, err := r.body() body, err := r.body()
if err != nil { if err != nil {
......
...@@ -978,10 +978,7 @@ func (m *RuncOptions) Unmarshal(dAtA []byte) error { ...@@ -978,10 +978,7 @@ func (m *RuncOptions) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthRunc
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthRunc return ErrInvalidLengthRunc
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1350,10 +1347,7 @@ func (m *CreateOptions) Unmarshal(dAtA []byte) error { ...@@ -1350,10 +1347,7 @@ func (m *CreateOptions) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthRunc
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthRunc return ErrInvalidLengthRunc
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1632,10 +1626,7 @@ func (m *CheckpointOptions) Unmarshal(dAtA []byte) error { ...@@ -1632,10 +1626,7 @@ func (m *CheckpointOptions) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthRunc
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthRunc return ErrInvalidLengthRunc
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1718,10 +1709,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { ...@@ -1718,10 +1709,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthRunc
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthRunc return ErrInvalidLengthRunc
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -174,6 +174,7 @@ func eaddrinuse(err error) bool { ...@@ -174,6 +174,7 @@ func eaddrinuse(err error) bool {
// setupOOMScore gets containerd's oom score and adds +1 to it // setupOOMScore gets containerd's oom score and adds +1 to it
// to ensure a shim has a lower* score than the daemons // to ensure a shim has a lower* score than the daemons
// if not already at the maximum OOM Score
func setupOOMScore(shimPid int) error { func setupOOMScore(shimPid int) error {
pid := os.Getpid() pid := os.Getpid()
score, err := sys.GetOOMScoreAdj(pid) score, err := sys.GetOOMScoreAdj(pid)
...@@ -181,6 +182,9 @@ func setupOOMScore(shimPid int) error { ...@@ -181,6 +182,9 @@ func setupOOMScore(shimPid int) error {
return errors.Wrap(err, "get daemon OOM score") return errors.Wrap(err, "get daemon OOM score")
} }
shimScore := score + 1 shimScore := score + 1
if shimScore > sys.OOMScoreAdjMax {
shimScore = sys.OOMScoreAdjMax
}
if err := sys.SetOOMScore(shimPid, shimScore); err != nil { if err := sys.SetOOMScore(shimPid, shimScore); err != nil {
return errors.Wrap(err, "set shim OOM score") return errors.Wrap(err, "set shim OOM score")
} }
......
...@@ -3262,10 +3262,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -3262,10 +3262,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3335,10 +3332,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error { ...@@ -3335,10 +3332,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3460,10 +3454,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error { ...@@ -3460,10 +3454,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3546,10 +3537,7 @@ func (m *DeleteProcessRequest) Unmarshal(dAtA []byte) error { ...@@ -3546,10 +3537,7 @@ func (m *DeleteProcessRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3784,10 +3772,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { ...@@ -3784,10 +3772,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3838,10 +3823,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { ...@@ -3838,10 +3823,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -3962,10 +3944,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error { ...@@ -3962,10 +3944,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4048,10 +4027,7 @@ func (m *StateRequest) Unmarshal(dAtA []byte) error { ...@@ -4048,10 +4027,7 @@ func (m *StateRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4372,10 +4348,7 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error { ...@@ -4372,10 +4348,7 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4497,10 +4470,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { ...@@ -4497,10 +4470,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4603,10 +4573,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error { ...@@ -4603,10 +4573,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4689,10 +4656,7 @@ func (m *ListPidsRequest) Unmarshal(dAtA []byte) error { ...@@ -4689,10 +4656,7 @@ func (m *ListPidsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4777,10 +4741,7 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error { ...@@ -4777,10 +4741,7 @@ func (m *ListPidsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4899,10 +4860,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -4899,10 +4860,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4972,10 +4930,7 @@ func (m *ShimInfoResponse) Unmarshal(dAtA []byte) error { ...@@ -4972,10 +4930,7 @@ func (m *ShimInfoResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5062,10 +5017,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -5062,10 +5017,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5148,10 +5100,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error { ...@@ -5148,10 +5100,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5253,10 +5202,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error { ...@@ -5253,10 +5202,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5339,10 +5285,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error { ...@@ -5339,10 +5285,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5445,10 +5388,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error { ...@@ -5445,10 +5388,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -115,6 +115,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_ ...@@ -115,6 +115,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
onCloseWithShimLog := func() { onCloseWithShimLog := func() {
onClose() onClose()
cancelShimLog() cancelShimLog()
f.Close()
} }
client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onCloseWithShimLog)) client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onCloseWithShimLog))
return &shim{ return &shim{
......
...@@ -159,7 +159,7 @@ func (m *TaskManager) Create(ctx context.Context, id string, opts runtime.Create ...@@ -159,7 +159,7 @@ func (m *TaskManager) Create(ctx context.Context, id string, opts runtime.Create
defer cancel() defer cancel()
_, errShim := shim.Delete(dctx) _, errShim := shim.Delete(dctx)
if errShim != nil { if errShim != nil {
shim.Shutdown(ctx) shim.Shutdown(dctx)
shim.Close() shim.Close()
} }
} }
......
...@@ -994,10 +994,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -994,10 +994,7 @@ func (m *Options) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthOci
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthOci return ErrInvalidLengthOci
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1276,10 +1273,7 @@ func (m *CheckpointOptions) Unmarshal(dAtA []byte) error { ...@@ -1276,10 +1273,7 @@ func (m *CheckpointOptions) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthOci
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthOci return ErrInvalidLengthOci
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -1362,10 +1356,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { ...@@ -1362,10 +1356,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthOci
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthOci return ErrInvalidLengthOci
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -483,7 +483,7 @@ func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (*taskAPI. ...@@ -483,7 +483,7 @@ func (s *service) State(ctx context.Context, r *taskAPI.StateRequest) (*taskAPI.
} }
p, err := container.Process(r.ExecID) p, err := container.Process(r.ExecID)
if err != nil { if err != nil {
return nil, err return nil, errdefs.ToGRPC(err)
} }
st, err := p.Status(ctx) st, err := p.Status(ctx)
if err != nil { if err != nil {
...@@ -662,9 +662,10 @@ func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*task ...@@ -662,9 +662,10 @@ func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (*task
func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) { func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (*ptypes.Empty, error) {
s.mu.Lock() s.mu.Lock()
defer s.mu.Unlock()
// return out if the shim is still servicing containers // return out if the shim is still servicing containers
if len(s.containers) > 0 { if len(s.containers) > 0 {
s.mu.Unlock()
return empty, nil return empty, nil
} }
s.cancel() s.cancel()
......
...@@ -76,7 +76,13 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt ...@@ -76,7 +76,13 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt
conn.Close() conn.Close()
} }
}() }()
f, err := openShimLog(ctx, bundle, client.AnonReconnectDialer) shimCtx, cancelShimLog := context.WithCancel(ctx)
defer func() {
if err != nil {
cancelShimLog()
}
}()
f, err := openShimLog(shimCtx, bundle, client.AnonReconnectDialer)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "open shim log pipe") return nil, errors.Wrap(err, "open shim log pipe")
} }
...@@ -99,8 +105,12 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt ...@@ -99,8 +105,12 @@ func loadShim(ctx context.Context, bundle *Bundle, events *exchange.Exchange, rt
} }
} }
}() }()
onCloseWithShimLog := func() {
client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onClose)) onClose()
cancelShimLog()
f.Close()
}
client := ttrpc.NewClient(conn, ttrpc.WithOnClose(onCloseWithShimLog))
defer func() { defer func() {
if err != nil { if err != nil {
client.Close() client.Close()
......
...@@ -53,6 +53,7 @@ func SetScore(pid int) error { ...@@ -53,6 +53,7 @@ func SetScore(pid int) error {
// AdjustOOMScore sets the OOM score for the process to the parents OOM score +1 // AdjustOOMScore sets the OOM score for the process to the parents OOM score +1
// to ensure that they parent has a lower* score than the shim // to ensure that they parent has a lower* score than the shim
// if not already at the maximum OOM Score
func AdjustOOMScore(pid int) error { func AdjustOOMScore(pid int) error {
parent := os.Getppid() parent := os.Getppid()
score, err := sys.GetOOMScoreAdj(parent) score, err := sys.GetOOMScoreAdj(parent)
...@@ -60,6 +61,9 @@ func AdjustOOMScore(pid int) error { ...@@ -60,6 +61,9 @@ func AdjustOOMScore(pid int) error {
return errors.Wrap(err, "get parent OOM score") return errors.Wrap(err, "get parent OOM score")
} }
shimScore := score + 1 shimScore := score + 1
if shimScore > sys.OOMScoreAdjMax {
shimScore = sys.OOMScoreAdjMax
}
if err := sys.SetOOMScore(pid, shimScore); err != nil { if err := sys.SetOOMScore(pid, shimScore); err != nil {
return errors.Wrap(err, "set shim OOM score") return errors.Wrap(err, "set shim OOM score")
} }
......
...@@ -30,7 +30,7 @@ import ( ...@@ -30,7 +30,7 @@ import (
) )
func openShimLog(ctx context.Context, bundle *Bundle, _ func(string, time.Duration) (net.Conn, error)) (io.ReadCloser, error) { func openShimLog(ctx context.Context, bundle *Bundle, _ func(string, time.Duration) (net.Conn, error)) (io.ReadCloser, error) {
return fifo.OpenFifo(ctx, filepath.Join(bundle.Path, "log"), unix.O_RDONLY|unix.O_CREAT|unix.O_NONBLOCK, 0700) return fifo.OpenFifo(ctx, filepath.Join(bundle.Path, "log"), unix.O_RDWR|unix.O_CREAT|unix.O_NONBLOCK, 0700)
} }
func checkCopyShimLogError(ctx context.Context, err error) error { func checkCopyShimLogError(ctx context.Context, err error) error {
......
...@@ -4019,10 +4019,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -4019,10 +4019,7 @@ func (m *CreateTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4092,10 +4089,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error { ...@@ -4092,10 +4089,7 @@ func (m *CreateTaskResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4210,10 +4204,7 @@ func (m *DeleteRequest) Unmarshal(dAtA []byte) error { ...@@ -4210,10 +4204,7 @@ func (m *DeleteRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4335,10 +4326,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error { ...@@ -4335,10 +4326,7 @@ func (m *DeleteResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4605,10 +4593,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { ...@@ -4605,10 +4593,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4659,10 +4644,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { ...@@ -4659,10 +4644,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4815,10 +4797,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error { ...@@ -4815,10 +4797,7 @@ func (m *ResizePtyRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -4933,10 +4912,7 @@ func (m *StateRequest) Unmarshal(dAtA []byte) error { ...@@ -4933,10 +4912,7 @@ func (m *StateRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5289,10 +5265,7 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error { ...@@ -5289,10 +5265,7 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5446,10 +5419,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error { ...@@ -5446,10 +5419,7 @@ func (m *KillRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5584,10 +5554,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error { ...@@ -5584,10 +5554,7 @@ func (m *CloseIORequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5670,10 +5637,7 @@ func (m *PidsRequest) Unmarshal(dAtA []byte) error { ...@@ -5670,10 +5637,7 @@ func (m *PidsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5758,10 +5722,7 @@ func (m *PidsResponse) Unmarshal(dAtA []byte) error { ...@@ -5758,10 +5722,7 @@ func (m *PidsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -5912,10 +5873,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -5912,10 +5873,7 @@ func (m *CheckpointTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6034,10 +5992,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error { ...@@ -6034,10 +5992,7 @@ func (m *UpdateTaskRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6152,10 +6107,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error { ...@@ -6152,10 +6107,7 @@ func (m *StartRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6225,10 +6177,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error { ...@@ -6225,10 +6177,7 @@ func (m *StartResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6343,10 +6292,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error { ...@@ -6343,10 +6292,7 @@ func (m *WaitRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6449,10 +6395,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error { ...@@ -6449,10 +6395,7 @@ func (m *WaitResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6535,10 +6478,7 @@ func (m *StatsRequest) Unmarshal(dAtA []byte) error { ...@@ -6535,10 +6478,7 @@ func (m *StatsRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6625,10 +6565,7 @@ func (m *StatsResponse) Unmarshal(dAtA []byte) error { ...@@ -6625,10 +6565,7 @@ func (m *StatsResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6711,10 +6648,7 @@ func (m *ConnectRequest) Unmarshal(dAtA []byte) error { ...@@ -6711,10 +6648,7 @@ func (m *ConnectRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6835,10 +6769,7 @@ func (m *ConnectResponse) Unmarshal(dAtA []byte) error { ...@@ -6835,10 +6769,7 @@ func (m *ConnectResponse) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -6941,10 +6872,7 @@ func (m *ShutdownRequest) Unmarshal(dAtA []byte) error { ...@@ -6941,10 +6872,7 @@ func (m *ShutdownRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -7027,10 +6955,7 @@ func (m *PauseRequest) Unmarshal(dAtA []byte) error { ...@@ -7027,10 +6955,7 @@ func (m *PauseRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -7113,10 +7038,7 @@ func (m *ResumeRequest) Unmarshal(dAtA []byte) error { ...@@ -7113,10 +7038,7 @@ func (m *ResumeRequest) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthShim
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthShim return ErrInvalidLengthShim
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
......
...@@ -26,6 +26,7 @@ import ( ...@@ -26,6 +26,7 @@ import (
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
"github.com/containerd/containerd/mount" "github.com/containerd/containerd/mount"
"github.com/containerd/containerd/sys"
"github.com/containerd/continuity/fs" "github.com/containerd/continuity/fs"
"github.com/pkg/errors" "github.com/pkg/errors"
) )
...@@ -86,3 +87,84 @@ func Supported(root string) error { ...@@ -86,3 +87,84 @@ func Supported(root string) error {
} }
return supportsMultipleLowerDir(root) return supportsMultipleLowerDir(root)
} }
// NeedsUserXAttr returns whether overlayfs should be mounted with the "userxattr" mount option.
//
// The "userxattr" option is needed for mounting overlayfs inside a user namespace with kernel >= 5.11.
//
// The "userxattr" option is NOT needed for the initial user namespace (aka "the host").
//
// Also, Ubuntu (since circa 2015) and Debian (since 10) with kernel < 5.11 can mount
// the overlayfs in a user namespace without the "userxattr" option.
//
// The corresponding kernel commit: https://github.com/torvalds/linux/commit/2d2f2d7322ff43e0fe92bf8cccdc0b09449bf2e1
// > ovl: user xattr
// >
// > Optionally allow using "user.overlay." namespace instead of "trusted.overlay."
// > ...
// > Disable redirect_dir and metacopy options, because these would allow privilege escalation through direct manipulation of the
// > "user.overlay.redirect" or "user.overlay.metacopy" xattrs.
// > ...
//
// The "userxattr" support is not exposed in "/sys/module/overlay/parameters".
func NeedsUserXAttr(d string) (bool, error) {
if !sys.RunningInUserNS() {
// we are the real root (i.e., the root in the initial user NS),
// so we do never need "userxattr" opt.
return false, nil
}
// TODO: add fast path for kernel >= 5.11 .
//
// Keep in mind that distro vendors might be going to backport the patch to older kernels.
// So we can't completely remove the check.
tdRoot := filepath.Join(d, "userxattr-check")
if err := os.RemoveAll(tdRoot); err != nil {
log.L.WithError(err).Warnf("Failed to remove check directory %v", tdRoot)
}
if err := os.MkdirAll(tdRoot, 0700); err != nil {
return false, err
}
defer func() {
if err := os.RemoveAll(tdRoot); err != nil {
log.L.WithError(err).Warnf("Failed to remove check directory %v", tdRoot)
}
}()
td, err := ioutil.TempDir(tdRoot, "")
if err != nil {
return false, err
}
for _, dir := range []string{"lower1", "lower2", "upper", "work", "merged"} {
if err := os.Mkdir(filepath.Join(td, dir), 0755); err != nil {
return false, err
}
}
opts := []string{
fmt.Sprintf("lowerdir=%s:%s,upperdir=%s,workdir=%s", filepath.Join(td, "lower2"), filepath.Join(td, "lower1"), filepath.Join(td, "upper"), filepath.Join(td, "work")),
"userxattr",
}
m := mount.Mount{
Type: "overlay",
Source: "overlay",
Options: opts,
}
dest := filepath.Join(td, "merged")
if err := m.Mount(dest); err != nil {
// Probably the host is running Ubuntu/Debian kernel (< 5.11) with the userns patch but without the userxattr patch.
// Return false without error.
log.L.WithError(err).Debugf("cannot mount overlay with \"userxattr\", probably the kernel does not support userxattr")
return false, nil
}
if err := mount.UnmountAll(dest, 0); err != nil {
log.L.WithError(err).Warnf("Failed to unmount check directory %v", dest)
}
return true, nil
}
...@@ -35,6 +35,7 @@ import ( ...@@ -35,6 +35,7 @@ import (
"github.com/containerd/containerd/snapshots/storage" "github.com/containerd/containerd/snapshots/storage"
"github.com/containerd/continuity/fs" "github.com/containerd/continuity/fs"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/sirupsen/logrus"
) )
func init() { func init() {
...@@ -71,6 +72,7 @@ type snapshotter struct { ...@@ -71,6 +72,7 @@ type snapshotter struct {
ms *storage.MetaStore ms *storage.MetaStore
asyncRemove bool asyncRemove bool
indexOff bool indexOff bool
userxattr bool // whether to enable "userxattr" mount option
} }
// NewSnapshotter returns a Snapshotter which uses overlayfs. The overlayfs // NewSnapshotter returns a Snapshotter which uses overlayfs. The overlayfs
...@@ -109,11 +111,18 @@ func NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error) { ...@@ -109,11 +111,18 @@ func NewSnapshotter(root string, opts ...Opt) (snapshots.Snapshotter, error) {
indexOff = true indexOff = true
} }
// figure out whether "userxattr" option is recognized by the kernel && needed
userxattr, err := NeedsUserXAttr(root)
if err != nil {
logrus.WithError(err).Warnf("cannot detect whether \"userxattr\" option needs to be used, assuming to be %v", userxattr)
}
return &snapshotter{ return &snapshotter{
root: root, root: root,
ms: ms, ms: ms,
asyncRemove: config.asyncRemove, asyncRemove: config.asyncRemove,
indexOff: indexOff, indexOff: indexOff,
userxattr: userxattr,
}, nil }, nil
} }
...@@ -478,6 +487,10 @@ func (o *snapshotter) mounts(s storage.Snapshot) []mount.Mount { ...@@ -478,6 +487,10 @@ func (o *snapshotter) mounts(s storage.Snapshot) []mount.Mount {
options = append(options, "index=off") options = append(options, "index=off")
} }
if o.userxattr {
options = append(options, "userxattr")
}
if s.Kind == snapshots.KindActive { if s.Kind == snapshots.KindActive {
options = append(options, options = append(options,
fmt.Sprintf("workdir=%s", o.workPath(s.ID)), fmt.Sprintf("workdir=%s", o.workPath(s.ID)),
......
...@@ -26,8 +26,12 @@ import ( ...@@ -26,8 +26,12 @@ import (
"strings" "strings"
) )
// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer const (
const OOMScoreMaxKillable = -999 // OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
OOMScoreMaxKillable = -999
// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/master/include/uapi/linux/oom.h
OOMScoreAdjMax = 1000
)
// SetOOMScore sets the oom score for the provided pid // SetOOMScore sets the oom score for the provided pid
func SetOOMScore(pid, score int) error { func SetOOMScore(pid, score int) error {
......
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
package sys package sys
const (
// OOMScoreAdjMax is not implemented on Windows
OOMScoreAdjMax = 0
)
// SetOOMScore sets the oom score for the process // SetOOMScore sets the oom score for the process
// //
// Not implemented on Windows // Not implemented on Windows
......
...@@ -23,7 +23,7 @@ var ( ...@@ -23,7 +23,7 @@ var (
Package = "github.com/containerd/containerd" Package = "github.com/containerd/containerd"
// Version holds the complete version number. Filled in at linking time. // Version holds the complete version number. Filled in at linking time.
Version = "1.4.3+unknown" Version = "1.4.4+unknown"
// Revision is filled with the VCS (e.g. git) revision being used to build // Revision is filled with the VCS (e.g. git) revision being used to build
// the program at linking time. // the program at linking time.
......
linters:
enable:
- structcheck
- varcheck
- staticcheck
- unconvert
- gofmt
- goimports
- golint
- ineffassign
- vet
- unused
- misspell
disable:
- errcheck
run:
timeout: 3m
language: go
sudo: required
go:
- 1.9.x
- 1.10.x
- 1.11.x
- tip
go_import_path: github.com/containerd/continuity
env:
# NOTE: we cannot set GOOS directly (because gimme overrides the value)
- TRAVIS_GOOS=windows
- TRAVIS_GOOS=linux
- TRAVIS_GOOS=darwin
install:
- go get -u github.com/vbatts/git-validation
- go get -u github.com/kunalkushwaha/ltag
- go get -u github.com/LK4D4/vndr
before_script:
- pushd ..; git clone https://github.com/containerd/project; popd
script:
- export GOOS=${TRAVIS_GOOS}
- DCO_VERBOSITY=-q ../project/script/validate/dco
- ../project/script/validate/fileheader ../project/
- ../project/script/validate/vendor
- make build binaries
- if [ "$GOOS" = "linux" ]; then make vet test; fi
- if [ "$GOOS" != "linux" ]; then make test-compile; fi
Aaron Lehmann <aaron.lehmann@docker.com> Aaron Lehmann <aaron.lehmann@docker.com>
Akash Gupta <akagup@microsoft.com> Akash Gupta <akagup@microsoft.com>
Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Akihiro Suda <suda.akihiro@lab.ntt.co.jp> Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Akihiro Suda <suda.kyoto@gmail.com>
Andrew Pennebaker <apennebaker@datapipe.com> Andrew Pennebaker <apennebaker@datapipe.com>
Brandon Philips <brandon.philips@coreos.com> Brandon Philips <brandon.philips@coreos.com>
Brian Goff <cpuguy83@gmail.com>
Christopher Jones <tophj@linux.vnet.ibm.com> Christopher Jones <tophj@linux.vnet.ibm.com>
Daniel, Dao Quang Minh <dqminh89@gmail.com> Daniel, Dao Quang Minh <dqminh89@gmail.com>
Darren Stahl <darst@microsoft.com>
Derek McGowan <derek@mcg.dev>
Derek McGowan <derek@mcgstyle.net> Derek McGowan <derek@mcgstyle.net>
Edward Pilatowicz <edward.pilatowicz@oracle.com> Edward Pilatowicz <edward.pilatowicz@oracle.com>
Ian Campbell <ijc@docker.com> Ian Campbell <ijc@docker.com>
Ivan Markin <sw@nogoegst.net>
Justin Cormack <justin.cormack@docker.com> Justin Cormack <justin.cormack@docker.com>
Justin Cummins <sul3n3t@gmail.com> Justin Cummins <sul3n3t@gmail.com>
Kasper Fabæch Brandt <poizan@poizan.dk>
Kir Kolyshkin <kolyshkin@gmail.com>
Michael Crosby <crosbymichael@gmail.com>
Michael Crosby <michael@thepasture.io>
Michael Wan <zirenwan@gmail.com>
Mike Brown <brownwm@us.ibm.com>
Niels de Vos <ndevos@redhat.com>
Phil Estes <estesp@gmail.com> Phil Estes <estesp@gmail.com>
Phil Estes <estesp@linux.vnet.ibm.com>
Samuel Karp <me@samuelkarp.com>
Sam Whited <sam@samwhited.com>
Sebastiaan van Stijn <github@gone.nl>
Shengjing Zhu <zhsj@debian.org>
Stephen J Day <stephen.day@docker.com> Stephen J Day <stephen.day@docker.com>
Tibor Vass <tibor@docker.com>
Tobias Klauser <tklauser@distanz.ch> Tobias Klauser <tklauser@distanz.ch>
Tom Faulhaber <tffaulha@amazon.com>
Tonis Tiigi <tonistiigi@gmail.com> Tonis Tiigi <tonistiigi@gmail.com>
Trevor Porter <trkporter@ucdavis.edu>
Wei Fu <fuweid89@gmail.com>
Wilbert van de Ridder <wilbert.ridder@gmail.com>
Xiaodong Ye <xiaodongy@vmware.com>
...@@ -18,14 +18,25 @@ PREFIX?=$(shell pwd) ...@@ -18,14 +18,25 @@ PREFIX?=$(shell pwd)
# Used to populate version variable in main package. # Used to populate version variable in main package.
VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always) VERSION=$(shell git describe --match 'v[0-9]*' --dirty='.m' --always)
GO_LDFLAGS=-ldflags "-X `go list ./version`.Version=$(VERSION)" GO_LDFLAGS=-ldflags "-X `go list -mod=vendor ./version`.Version=$(VERSION)"
PACKAGES=$(shell go list ./... | grep -v /vendor/) PKG=github.com/containerd/continuity
.PHONY: clean all fmt vet lint build test binaries setup PACKAGES=$(shell go list -mod=vendor ./... | grep -v /vendor/)
TEST_REQUIRES_ROOT_PACKAGES=$(filter \
${PACKAGES}, \
$(shell \
for f in $$(git grep -l testutil.RequiresRoot | grep -v Makefile); do \
d="$$(dirname $$f)"; \
[ "$$d" = "." ] && echo "${PKG}" && continue; \
echo "${PKG}/$$d"; \
done | sort -u) \
)
.PHONY: clean all lint build test binaries
.DEFAULT: default .DEFAULT: default
# skip lint at the moment
all: AUTHORS clean fmt vet fmt build test binaries all: AUTHORS clean lint build test binaries
AUTHORS: .mailmap .git/HEAD AUTHORS: .mailmap .git/HEAD
git log --format='%aN <%aE>' | sort -fu > $@ git log --format='%aN <%aE>' | sort -fu > $@
...@@ -36,41 +47,30 @@ version/version.go: ...@@ -36,41 +47,30 @@ version/version.go:
${PREFIX}/bin/continuity: version/version.go $(shell find . -type f -name '*.go') ${PREFIX}/bin/continuity: version/version.go $(shell find . -type f -name '*.go')
@echo "+ $@" @echo "+ $@"
@go build -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/continuity @go build -mod=vendor -o $@ ${GO_LDFLAGS} ${GO_GCFLAGS} ./cmd/continuity
setup:
@echo "+ $@"
@go get -u github.com/golang/lint/golint
generate: generate:
go generate $(PACKAGES) go generate -mod=vendor $(PACKAGES)
# Depends on binaries because vet will silently fail if it can't load compiled
# imports
vet: binaries
@echo "+ $@"
@go vet $(PACKAGES)
fmt:
@echo "+ $@"
@test -z "$$(gofmt -s -l . | grep -v Godeps/_workspace/src/ | grep -v vendor/ | tee /dev/stderr)" || \
echo "+ please format Go code with 'gofmt -s'"
lint: lint:
@echo "+ $@" @echo "+ $@"
@test -z "$$(golint $(PACKAGES) | grep -v Godeps/_workspace/src/ | grep -v vendor/ |tee /dev/stderr)" @golangci-lint run
build: build:
@echo "+ $@" @echo "+ $@"
@go build -v ${GO_LDFLAGS} $(PACKAGES) @go build -mod=vendor -v ${GO_LDFLAGS} $(PACKAGES)
test: test:
@echo "+ $@" @echo "+ $@"
@go test $(PACKAGES) @go test -mod=vendor $(PACKAGES)
root-test:
@echo "+ $@"
@go test ${TEST_REQUIRES_ROOT_PACKAGES} -test.root
test-compile: test-compile:
@echo "+ $@" @echo "+ $@"
@for pkg in $(PACKAGES); do go test -c $$pkg; done @for pkg in $(PACKAGES); do go test -mod=vendor -c $$pkg; done
binaries: ${PREFIX}/bin/continuity binaries: ${PREFIX}/bin/continuity
@echo "+ $@" @echo "+ $@"
......
...@@ -63,6 +63,10 @@ $ stat -c %a Makefile ...@@ -63,6 +63,10 @@ $ stat -c %a Makefile
$ ./bin/continuity verify . /tmp/a.pb $ ./bin/continuity verify . /tmp/a.pb
``` ```
## Platforms
continuity primarily targets Linux. continuity may compile for and work on
other operating systems, but those platforms are not tested.
## Contribution Guide ## Contribution Guide
### Building Proto Package ### Building Proto Package
......
...@@ -596,7 +596,7 @@ func (c *context) Walk(fn filepath.WalkFunc) error { ...@@ -596,7 +596,7 @@ func (c *context) Walk(fn filepath.WalkFunc) error {
return err return err
} }
} }
return c.pathDriver.Walk(root, func(p string, fi os.FileInfo, err error) error { return c.pathDriver.Walk(root, func(p string, fi os.FileInfo, _ error) error {
contained, err := c.containWithRoot(p, root) contained, err := c.containWithRoot(p, root)
return fn(contained, fi, err) return fn(contained, fi, err)
}) })
...@@ -613,12 +613,6 @@ func (c *context) fullpath(p string) (string, error) { ...@@ -613,12 +613,6 @@ func (c *context) fullpath(p string) (string, error) {
return p, nil return p, nil
} }
// contain cleans and santizes the filesystem path p to be an absolute path,
// effectively relative to the context root.
func (c *context) contain(p string) (string, error) {
return c.containWithRoot(p, c.root)
}
// containWithRoot cleans and santizes the filesystem path p to be an absolute path, // containWithRoot cleans and santizes the filesystem path p to be an absolute path,
// effectively relative to the passed root. Extra care should be used when calling this // effectively relative to the passed root. Extra care should be used when calling this
// instead of contain. This is needed for Walk, as if context root is a symlink, // instead of contain. This is needed for Walk, as if context root is a symlink,
......
...@@ -32,6 +32,7 @@ func DeviceInfo(fi os.FileInfo) (uint64, uint64, error) { ...@@ -32,6 +32,7 @@ func DeviceInfo(fi os.FileInfo) (uint64, uint64, error) {
return 0, 0, fmt.Errorf("cannot extract device from os.FileInfo") return 0, 0, fmt.Errorf("cannot extract device from os.FileInfo")
} }
//nolint:unconvert
dev := uint64(sys.Rdev) dev := uint64(sys.Rdev)
return uint64(unix.Major(dev)), uint64(unix.Minor(dev)), nil return uint64(unix.Major(dev)), uint64(unix.Minor(dev)), nil
} }
...@@ -55,7 +56,7 @@ func Mknod(p string, mode os.FileMode, maj, min int) error { ...@@ -55,7 +56,7 @@ func Mknod(p string, mode os.FileMode, maj, min int) error {
m |= unix.S_IFIFO m |= unix.S_IFIFO
} }
return unix.Mknod(p, m, int(dev)) return mknod(p, m, dev)
} }
// syscallMode returns the syscall-specific mode bits from Go's portable mode bits. // syscallMode returns the syscall-specific mode bits from Go's portable mode bits.
......
// +build !windows // +build freebsd
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.
...@@ -16,11 +16,10 @@ ...@@ -16,11 +16,10 @@
limitations under the License. limitations under the License.
*/ */
package syscallx package devices
import "syscall" import "golang.org/x/sys/unix"
// Readlink returns the destination of the named symbolic link. func mknod(path string, mode uint32, dev uint64) (err error) {
func Readlink(path string, buf []byte) (n int, err error) { return unix.Mknod(path, mode, dev)
return syscall.Readlink(path, buf)
} }
// +build linux darwin solaris
/*
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 devices
import "golang.org/x/sys/unix"
func mknod(path string, mode uint32, dev uint64) (err error) {
return unix.Mknod(path, mode, int(dev))
}
...@@ -88,13 +88,9 @@ func digestsMatch(as, bs []digest.Digest) bool { ...@@ -88,13 +88,9 @@ func digestsMatch(as, bs []digest.Digest) bool {
} }
disjoint := len(as) + len(bs) disjoint := len(as) + len(bs)
if len(uniqified) == disjoint { // if these two sets have the same cardinality, we know both sides
// if these two sets have the same cardinality, we know both sides // didn't share any digests.
// didn't share any digests. return len(uniqified) != disjoint
return false
}
return true
} }
type digestSlice []digest.Digest type digestSlice []digest.Digest
......
...@@ -138,6 +138,10 @@ func (d *driver) Lstat(p string) (os.FileInfo, error) { ...@@ -138,6 +138,10 @@ func (d *driver) Lstat(p string) (os.FileInfo, error) {
return os.Lstat(p) return os.Lstat(p)
} }
func (d *driver) Readlink(p string) (string, error) {
return os.Readlink(p)
}
func (d *driver) Mkdir(p string, mode os.FileMode) error { func (d *driver) Mkdir(p string, mode os.FileMode) error {
return os.Mkdir(p, mode) return os.Mkdir(p, mode)
} }
......
...@@ -131,8 +131,3 @@ func (d *driver) LSetxattr(path string, attrMap map[string][]byte) error { ...@@ -131,8 +131,3 @@ func (d *driver) LSetxattr(path string, attrMap map[string][]byte) error {
func (d *driver) DeviceInfo(fi os.FileInfo) (maj uint64, min uint64, err error) { func (d *driver) DeviceInfo(fi os.FileInfo) (maj uint64, min uint64, err error) {
return devices.DeviceInfo(fi) return devices.DeviceInfo(fi)
} }
// Readlink was forked on Windows to fix a Golang bug, use the "os" package here
func (d *driver) Readlink(p string) (string, error) {
return os.Readlink(p)
}
// +build go1.13
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.
...@@ -14,12 +16,14 @@ ...@@ -14,12 +16,14 @@
limitations under the License. limitations under the License.
*/ */
// Go 1.13 is the minimally supported version for Windows.
// Earlier golang releases have bug in os.Readlink
// (see https://github.com/golang/go/issues/30463).
package driver package driver
import ( import (
"os" "os"
"github.com/containerd/continuity/sysx"
) )
func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error { func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
...@@ -35,9 +39,3 @@ func (d *driver) Lchmod(path string, mode os.FileMode) (err error) { ...@@ -35,9 +39,3 @@ func (d *driver) Lchmod(path string, mode os.FileMode) (err error) {
// TODO: Use Window's equivalent // TODO: Use Window's equivalent
return os.Chmod(path, mode) return os.Chmod(path, mode)
} }
// Readlink is forked in order to support Volume paths which are used
// in container layers.
func (d *driver) Readlink(p string) (string, error) {
return sysx.Readlink(p)
}
...@@ -39,6 +39,8 @@ type XAttrErrorHandler func(dst, src, xattrKey string, err error) error ...@@ -39,6 +39,8 @@ type XAttrErrorHandler func(dst, src, xattrKey string, err error) error
type copyDirOpts struct { type copyDirOpts struct {
xeh XAttrErrorHandler xeh XAttrErrorHandler
// xex contains a set of xattrs to exclude when copying
xex map[string]struct{}
} }
type CopyDirOpt func(*copyDirOpts) error type CopyDirOpt func(*copyDirOpts) error
...@@ -61,6 +63,19 @@ func WithAllowXAttrErrors() CopyDirOpt { ...@@ -61,6 +63,19 @@ func WithAllowXAttrErrors() CopyDirOpt {
return WithXAttrErrorHandler(xeh) return WithXAttrErrorHandler(xeh)
} }
// WithXAttrExclude allows for exclusion of specified xattr during CopyDir operation.
func WithXAttrExclude(keys ...string) CopyDirOpt {
return func(o *copyDirOpts) error {
if o.xex == nil {
o.xex = make(map[string]struct{}, len(keys))
}
for _, key := range keys {
o.xex[key] = struct{}{}
}
return nil
}
}
// CopyDir copies the directory from src to dst. // CopyDir copies the directory from src to dst.
// Most efficient copy of files is attempted. // Most efficient copy of files is attempted.
func CopyDir(dst, src string, opts ...CopyDirOpt) error { func CopyDir(dst, src string, opts ...CopyDirOpt) error {
...@@ -80,7 +95,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er ...@@ -80,7 +95,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
return errors.Wrapf(err, "failed to stat %s", src) return errors.Wrapf(err, "failed to stat %s", src)
} }
if !stat.IsDir() { if !stat.IsDir() {
return errors.Errorf("source is not directory") return errors.Errorf("source %s is not directory", src)
} }
if st, err := os.Stat(dst); err != nil { if st, err := os.Stat(dst); err != nil {
...@@ -104,6 +119,10 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er ...@@ -104,6 +119,10 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
return errors.Wrapf(err, "failed to copy file info for %s", dst) return errors.Wrapf(err, "failed to copy file info for %s", dst)
} }
if err := copyXAttrs(dst, src, o.xex, o.xeh); err != nil {
return errors.Wrap(err, "failed to copy xattrs")
}
for _, fi := range fis { for _, fi := range fis {
source := filepath.Join(src, fi.Name()) source := filepath.Join(src, fi.Name())
target := filepath.Join(dst, fi.Name()) target := filepath.Join(dst, fi.Name())
...@@ -146,7 +165,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er ...@@ -146,7 +165,7 @@ func copyDirectory(dst, src string, inodes map[uint64]string, o *copyDirOpts) er
return errors.Wrap(err, "failed to copy file info") return errors.Wrap(err, "failed to copy file info")
} }
if err := copyXAttrs(target, source, o.xeh); err != nil { if err := copyXAttrs(target, source, o.xex, o.xeh); err != nil {
return errors.Wrap(err, "failed to copy xattrs") return errors.Wrap(err, "failed to copy xattrs")
} }
} }
......
// +build darwin openbsd solaris
/*
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 fs
import (
"os"
"syscall"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
func copyDevice(dst string, fi os.FileInfo) error {
st, ok := fi.Sys().(*syscall.Stat_t)
if !ok {
return errors.New("unsupported stat type")
}
return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
}
func utimesNano(name string, atime, mtime syscall.Timespec) error {
timespec := []syscall.Timespec{atime, mtime}
return syscall.UtimesNano(name, timespec)
}
// +build freebsd
/*
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 fs
import (
"os"
"syscall"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
func copyDevice(dst string, fi os.FileInfo) error {
st, ok := fi.Sys().(*syscall.Stat_t)
if !ok {
return errors.New("unsupported stat type")
}
return unix.Mknod(dst, uint32(fi.Mode()), st.Rdev)
}
func utimesNano(name string, atime, mtime syscall.Timespec) error {
at := unix.NsecToTimespec(atime.Nano())
mt := unix.NsecToTimespec(mtime.Nano())
utimes := [2]unix.Timespec{at, mt}
return unix.UtimesNanoAt(unix.AT_FDCWD, name, utimes[0:], unix.AT_SYMLINK_NOFOLLOW)
}
...@@ -51,7 +51,10 @@ func copyFileInfo(fi os.FileInfo, name string) error { ...@@ -51,7 +51,10 @@ func copyFileInfo(fi os.FileInfo, name string) error {
} }
} }
timespec := []unix.Timespec{unix.Timespec(StatAtime(st)), unix.Timespec(StatMtime(st))} timespec := []unix.Timespec{
unix.NsecToTimespec(syscall.TimespecToNsec(StatAtime(st))),
unix.NsecToTimespec(syscall.TimespecToNsec(StatMtime(st))),
}
if err := unix.UtimesNanoAt(unix.AT_FDCWD, name, timespec, unix.AT_SYMLINK_NOFOLLOW); err != nil { if err := unix.UtimesNanoAt(unix.AT_FDCWD, name, timespec, unix.AT_SYMLINK_NOFOLLOW); err != nil {
return errors.Wrapf(err, "failed to utime %s", name) return errors.Wrapf(err, "failed to utime %s", name)
} }
...@@ -101,21 +104,24 @@ func copyFileContent(dst, src *os.File) error { ...@@ -101,21 +104,24 @@ func copyFileContent(dst, src *os.File) error {
return nil return nil
} }
func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error {
xattrKeys, err := sysx.LListxattr(src) xattrKeys, err := sysx.LListxattr(src)
if err != nil { if err != nil {
e := errors.Wrapf(err, "failed to list xattrs on %s", src) e := errors.Wrapf(err, "failed to list xattrs on %s", src)
if xeh != nil { if errorHandler != nil {
e = xeh(dst, src, "", e) e = errorHandler(dst, src, "", e)
} }
return e return e
} }
for _, xattr := range xattrKeys { for _, xattr := range xattrKeys {
if _, exclude := excludes[xattr]; exclude {
continue
}
data, err := sysx.LGetxattr(src, xattr) data, err := sysx.LGetxattr(src, xattr)
if err != nil { if err != nil {
e := errors.Wrapf(err, "failed to get xattr %q on %s", xattr, src) e := errors.Wrapf(err, "failed to get xattr %q on %s", xattr, src)
if xeh != nil { if errorHandler != nil {
if e = xeh(dst, src, xattr, e); e == nil { if e = errorHandler(dst, src, xattr, e); e == nil {
continue continue
} }
} }
...@@ -123,8 +129,8 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { ...@@ -123,8 +129,8 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error {
} }
if err := sysx.LSetxattr(dst, xattr, data, 0); err != nil { if err := sysx.LSetxattr(dst, xattr, data, 0); err != nil {
e := errors.Wrapf(err, "failed to set xattr %q on %s", xattr, dst) e := errors.Wrapf(err, "failed to set xattr %q on %s", xattr, dst)
if xeh != nil { if errorHandler != nil {
if e = xeh(dst, src, xattr, e); e == nil { if e = errorHandler(dst, src, xattr, e); e == nil {
continue continue
} }
} }
......
// +build solaris darwin freebsd // +build darwin freebsd openbsd solaris
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.
...@@ -25,7 +25,6 @@ import ( ...@@ -25,7 +25,6 @@ import (
"github.com/containerd/continuity/sysx" "github.com/containerd/continuity/sysx"
"github.com/pkg/errors" "github.com/pkg/errors"
"golang.org/x/sys/unix"
) )
func copyFileInfo(fi os.FileInfo, name string) error { func copyFileInfo(fi os.FileInfo, name string) error {
...@@ -53,8 +52,7 @@ func copyFileInfo(fi os.FileInfo, name string) error { ...@@ -53,8 +52,7 @@ func copyFileInfo(fi os.FileInfo, name string) error {
} }
} }
timespec := []syscall.Timespec{StatAtime(st), StatMtime(st)} if err := utimesNano(name, StatAtime(st), StatMtime(st)); err != nil {
if err := syscall.UtimesNano(name, timespec); err != nil {
return errors.Wrapf(err, "failed to utime %s", name) return errors.Wrapf(err, "failed to utime %s", name)
} }
...@@ -69,21 +67,24 @@ func copyFileContent(dst, src *os.File) error { ...@@ -69,21 +67,24 @@ func copyFileContent(dst, src *os.File) error {
return err return err
} }
func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error {
xattrKeys, err := sysx.LListxattr(src) xattrKeys, err := sysx.LListxattr(src)
if err != nil { if err != nil {
e := errors.Wrapf(err, "failed to list xattrs on %s", src) e := errors.Wrapf(err, "failed to list xattrs on %s", src)
if xeh != nil { if errorHandler != nil {
e = xeh(dst, src, "", e) e = errorHandler(dst, src, "", e)
} }
return e return e
} }
for _, xattr := range xattrKeys { for _, xattr := range xattrKeys {
if _, exclude := excludes[xattr]; exclude {
continue
}
data, err := sysx.LGetxattr(src, xattr) data, err := sysx.LGetxattr(src, xattr)
if err != nil { if err != nil {
e := errors.Wrapf(err, "failed to get xattr %q on %s", xattr, src) e := errors.Wrapf(err, "failed to get xattr %q on %s", xattr, src)
if xeh != nil { if errorHandler != nil {
if e = xeh(dst, src, xattr, e); e == nil { if e = errorHandler(dst, src, xattr, e); e == nil {
continue continue
} }
} }
...@@ -91,8 +92,8 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { ...@@ -91,8 +92,8 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error {
} }
if err := sysx.LSetxattr(dst, xattr, data, 0); err != nil { if err := sysx.LSetxattr(dst, xattr, data, 0); err != nil {
e := errors.Wrapf(err, "failed to set xattr %q on %s", xattr, dst) e := errors.Wrapf(err, "failed to set xattr %q on %s", xattr, dst)
if xeh != nil { if errorHandler != nil {
if e = xeh(dst, src, xattr, e); e == nil { if e = errorHandler(dst, src, xattr, e); e == nil {
continue continue
} }
} }
...@@ -102,11 +103,3 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { ...@@ -102,11 +103,3 @@ func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error {
return nil return nil
} }
func copyDevice(dst string, fi os.FileInfo) error {
st, ok := fi.Sys().(*syscall.Stat_t)
if !ok {
return errors.New("unsupported stat type")
}
return unix.Mknod(dst, uint32(fi.Mode()), int(st.Rdev))
}
...@@ -40,7 +40,7 @@ func copyFileContent(dst, src *os.File) error { ...@@ -40,7 +40,7 @@ func copyFileContent(dst, src *os.File) error {
return err return err
} }
func copyXAttrs(dst, src string, xeh XAttrErrorHandler) error { func copyXAttrs(dst, src string, excludes map[string]struct{}, errorHandler XAttrErrorHandler) error {
return nil return nil
} }
......
...@@ -25,6 +25,14 @@ import ( ...@@ -25,6 +25,14 @@ import (
"syscall" "syscall"
) )
// blocksUnitSize is the unit used by `st_blocks` in `stat` in bytes.
// See https://man7.org/linux/man-pages/man2/stat.2.html
// st_blocks
// This field indicates the number of blocks allocated to the
// file, in 512-byte units. (This may be smaller than
// st_size/512 when the file has holes.)
const blocksUnitSize = 512
type inode struct { type inode struct {
// TODO(stevvooe): Can probably reduce memory usage by not tracking // TODO(stevvooe): Can probably reduce memory usage by not tracking
// device, but we can leave this right for now. // device, but we can leave this right for now.
...@@ -33,9 +41,9 @@ type inode struct { ...@@ -33,9 +41,9 @@ type inode struct {
func newInode(stat *syscall.Stat_t) inode { func newInode(stat *syscall.Stat_t) inode {
return inode{ return inode{
// Dev is uint32 on darwin/bsd, uint64 on linux/solaris // Dev is uint32 on darwin/bsd, uint64 on linux/solaris/freebsd
dev: uint64(stat.Dev), // nolint: unconvert dev: uint64(stat.Dev), // nolint: unconvert
// Ino is uint32 on bsd, uint64 on darwin/linux/solaris // Ino is uint32 on bsd, uint64 on darwin/linux/solaris/freebsd
ino: uint64(stat.Ino), // nolint: unconvert ino: uint64(stat.Ino), // nolint: unconvert
} }
} }
...@@ -59,10 +67,11 @@ func diskUsage(ctx context.Context, roots ...string) (Usage, error) { ...@@ -59,10 +67,11 @@ func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
default: default:
} }
inoKey := newInode(fi.Sys().(*syscall.Stat_t)) stat := fi.Sys().(*syscall.Stat_t)
inoKey := newInode(stat)
if _, ok := inodes[inoKey]; !ok { if _, ok := inodes[inoKey]; !ok {
inodes[inoKey] = struct{}{} inodes[inoKey] = struct{}{}
size += fi.Size() size += stat.Blocks * blocksUnitSize
} }
return nil return nil
...@@ -89,10 +98,11 @@ func diffUsage(ctx context.Context, a, b string) (Usage, error) { ...@@ -89,10 +98,11 @@ func diffUsage(ctx context.Context, a, b string) (Usage, error) {
} }
if kind == ChangeKindAdd || kind == ChangeKindModify { if kind == ChangeKindAdd || kind == ChangeKindModify {
inoKey := newInode(fi.Sys().(*syscall.Stat_t)) stat := fi.Sys().(*syscall.Stat_t)
inoKey := newInode(stat)
if _, ok := inodes[inoKey]; !ok { if _, ok := inodes[inoKey]; !ok {
inodes[inoKey] = struct{}{} inodes[inoKey] = struct{}{}
size += fi.Size() size += stat.Blocks * blocksUnitSize
} }
return nil return nil
......
...@@ -117,15 +117,13 @@ func sameFile(f1, f2 *currentPath) (bool, error) { ...@@ -117,15 +117,13 @@ func sameFile(f1, f2 *currentPath) (bool, error) {
// If the timestamp may have been truncated in both of the // If the timestamp may have been truncated in both of the
// files, check content of file to determine difference // files, check content of file to determine difference
if t1.Nanosecond() == 0 && t2.Nanosecond() == 0 { if t1.Nanosecond() == 0 && t2.Nanosecond() == 0 {
var eq bool
if (f1.f.Mode() & os.ModeSymlink) == os.ModeSymlink { if (f1.f.Mode() & os.ModeSymlink) == os.ModeSymlink {
eq, err = compareSymlinkTarget(f1.fullPath, f2.fullPath) return compareSymlinkTarget(f1.fullPath, f2.fullPath)
} else if f1.f.Size() > 0 {
eq, err = compareFileContent(f1.fullPath, f2.fullPath)
} }
if err != nil || !eq { if f1.f.Size() == 0 { // if file sizes are zero length, the files are the same by definition
return eq, err return true, nil
} }
return compareFileContent(f1.fullPath, f2.fullPath)
} else if t1.Nanosecond() != t2.Nanosecond() { } else if t1.Nanosecond() != t2.Nanosecond() {
return false, nil return false, nil
} }
......
// +build linux openbsd
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.
......
module github.com/containerd/continuity
go 1.13
require (
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898
github.com/dustin/go-humanize v1.0.0
github.com/golang/protobuf v1.2.0
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.7.0
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95 // indirect
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd // indirect
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3
)
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898 h1:SC+c6A1qTFstO9qmB86mPV2IpYme/2ZoEQ0hrP+wo+Q=
bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo=
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee h1:GQkkv3XSnxhAMjdq2wLfEnptEVr+2BNvmHizILHn+d4=
github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95 h1:j8jxLbQ0+T1DFggy6XoGvyUnrJWPR/JybflPvu5rwS4=
github.com/spf13/pflag v1.0.1-0.20171106142849-4c012f6dcd95/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 h1:kzM6+9dur93BcC2kVlYl34cHU+TYZLanmpSJHVMmL64=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
limitations under the License. limitations under the License.
*/ */
//nolint:unused,deadcode
package continuity package continuity
import ( import (
......
...@@ -53,7 +53,7 @@ func (hlm *hardlinkManager) Add(fi os.FileInfo, resource Resource) error { ...@@ -53,7 +53,7 @@ func (hlm *hardlinkManager) Add(fi os.FileInfo, resource Resource) error {
} }
// Merge processes the current state of the hardlink manager and merges any // Merge processes the current state of the hardlink manager and merges any
// shared nodes into hardlinked resources. // shared nodes into hard linked resources.
func (hlm *hardlinkManager) Merge() ([]Resource, error) { func (hlm *hardlinkManager) Merge() ([]Resource, error) {
var resources []Resource var resources []Resource
for key, linked := range hlm.hardlinks { for key, linked := range hlm.hardlinks {
......
...@@ -48,5 +48,6 @@ func newHardlinkKey(fi os.FileInfo) (hardlinkKey, error) { ...@@ -48,5 +48,6 @@ func newHardlinkKey(fi os.FileInfo) (hardlinkKey, error) {
return hardlinkKey{}, errNotAHardLink return hardlinkKey{}, errNotAHardLink
} }
//nolint:unconvert
return hardlinkKey{dev: uint64(sys.Dev), inode: uint64(sys.Ino)}, nil return hardlinkKey{dev: uint64(sys.Dev), inode: uint64(sys.Ino)}, nil
} }
...@@ -114,11 +114,13 @@ func BuildManifest(ctx Context) (*Manifest, error) { ...@@ -114,11 +114,13 @@ func BuildManifest(ctx Context) (*Manifest, error) {
} }
// merge and post-process the hardlinks. // merge and post-process the hardlinks.
// nolint:misspell
hardlinked, err := hardlinks.Merge() hardlinked, err := hardlinks.Merge()
if err != nil { if err != nil {
return nil, err return nil, err
} }
// nolint:misspell
for _, resource := range hardlinked { for _, resource := range hardlinked {
resourcesByPath[resource.Path()] = resource resourcesByPath[resource.Path()] = resource
} }
......
/*
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 syscallx
import (
"syscall"
"unsafe"
)
type reparseDataBuffer struct {
ReparseTag uint32
ReparseDataLength uint16
Reserved uint16
// GenericReparseBuffer
reparseBuffer byte
}
type mountPointReparseBuffer struct {
SubstituteNameOffset uint16
SubstituteNameLength uint16
PrintNameOffset uint16
PrintNameLength uint16
PathBuffer [1]uint16
}
type symbolicLinkReparseBuffer struct {
SubstituteNameOffset uint16
SubstituteNameLength uint16
PrintNameOffset uint16
PrintNameLength uint16
Flags uint32
PathBuffer [1]uint16
}
const (
_IO_REPARSE_TAG_MOUNT_POINT = 0xA0000003
_SYMLINK_FLAG_RELATIVE = 1
)
// Readlink returns the destination of the named symbolic link.
func Readlink(path string, buf []byte) (n int, err error) {
fd, err := syscall.CreateFile(syscall.StringToUTF16Ptr(path), syscall.GENERIC_READ, 0, nil, syscall.OPEN_EXISTING,
syscall.FILE_FLAG_OPEN_REPARSE_POINT|syscall.FILE_FLAG_BACKUP_SEMANTICS, 0)
if err != nil {
return -1, err
}
defer syscall.CloseHandle(fd)
rdbbuf := make([]byte, syscall.MAXIMUM_REPARSE_DATA_BUFFER_SIZE)
var bytesReturned uint32
err = syscall.DeviceIoControl(fd, syscall.FSCTL_GET_REPARSE_POINT, nil, 0, &rdbbuf[0], uint32(len(rdbbuf)), &bytesReturned, nil)
if err != nil {
return -1, err
}
rdb := (*reparseDataBuffer)(unsafe.Pointer(&rdbbuf[0]))
var s string
switch rdb.ReparseTag {
case syscall.IO_REPARSE_TAG_SYMLINK:
data := (*symbolicLinkReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer))
p := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0]))
s = syscall.UTF16ToString(p[data.SubstituteNameOffset/2 : (data.SubstituteNameOffset+data.SubstituteNameLength)/2])
if data.Flags&_SYMLINK_FLAG_RELATIVE == 0 {
if len(s) >= 4 && s[:4] == `\??\` {
s = s[4:]
switch {
case len(s) >= 2 && s[1] == ':': // \??\C:\foo\bar
// do nothing
case len(s) >= 4 && s[:4] == `UNC\`: // \??\UNC\foo\bar
s = `\\` + s[4:]
default:
// unexpected; do nothing
}
} else {
// unexpected; do nothing
}
}
case _IO_REPARSE_TAG_MOUNT_POINT:
data := (*mountPointReparseBuffer)(unsafe.Pointer(&rdb.reparseBuffer))
p := (*[0xffff]uint16)(unsafe.Pointer(&data.PathBuffer[0]))
s = syscall.UTF16ToString(p[data.SubstituteNameOffset/2 : (data.SubstituteNameOffset+data.SubstituteNameLength)/2])
if len(s) >= 4 && s[:4] == `\??\` { // \??\C:\foo\bar
if len(s) < 48 || s[:11] != `\??\Volume{` {
s = s[4:]
}
} else {
// unexpected; do nothing
}
default:
// the path is not a symlink or junction but another type of reparse
// point
return -1, syscall.ENOENT
}
n = copy(buf, []byte(s))
return n, nil
}
/*
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 sysx
import (
"os"
"path/filepath"
"github.com/containerd/continuity/syscallx"
)
// Readlink returns the destination of the named symbolic link.
// If there is an error, it will be of type *PathError.
func Readlink(name string) (string, error) {
for len := 128; ; len *= 2 {
b := make([]byte, len)
n, e := fixCount(syscallx.Readlink(fixLongPath(name), b))
if e != nil {
return "", &os.PathError{Op: "readlink", Path: name, Err: e}
}
if n < len {
return string(b[0:n]), nil
}
}
}
// Many functions in package syscall return a count of -1 instead of 0.
// Using fixCount(call()) instead of call() corrects the count.
func fixCount(n int, err error) (int, error) {
if n < 0 {
n = 0
}
return n, err
}
// fixLongPath returns the extended-length (\\?\-prefixed) form of
// path when needed, in order to avoid the default 260 character file
// path limit imposed by Windows. If path is not easily converted to
// the extended-length form (for example, if path is a relative path
// or contains .. elements), or is short enough, fixLongPath returns
// path unmodified.
//
// See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
func fixLongPath(path string) string {
// Do nothing (and don't allocate) if the path is "short".
// Empirically (at least on the Windows Server 2013 builder),
// the kernel is arbitrarily okay with < 248 bytes. That
// matches what the docs above say:
// "When using an API to create a directory, the specified
// path cannot be so long that you cannot append an 8.3 file
// name (that is, the directory name cannot exceed MAX_PATH
// minus 12)." Since MAX_PATH is 260, 260 - 12 = 248.
//
// The MSDN docs appear to say that a normal path that is 248 bytes long
// will work; empirically the path must be less then 248 bytes long.
if len(path) < 248 {
// Don't fix. (This is how Go 1.7 and earlier worked,
// not automatically generating the \\?\ form)
return path
}
// The extended form begins with \\?\, as in
// \\?\c:\windows\foo.txt or \\?\UNC\server\share\foo.txt.
// The extended form disables evaluation of . and .. path
// elements and disables the interpretation of / as equivalent
// to \. The conversion here rewrites / to \ and elides
// . elements as well as trailing or duplicate separators. For
// simplicity it avoids the conversion entirely for relative
// paths or paths containing .. elements. For now,
// \\server\share paths are not converted to
// \\?\UNC\server\share paths because the rules for doing so
// are less well-specified.
if len(path) >= 2 && path[:2] == `\\` {
// Don't canonicalize UNC paths.
return path
}
if !filepath.IsAbs(path) {
// Relative path
return path
}
const prefix = `\\?`
pathbuf := make([]byte, len(prefix)+len(path)+len(`\`))
copy(pathbuf, prefix)
n := len(path)
r, w := 0, len(prefix)
for r < n {
switch {
case os.IsPathSeparator(path[r]):
// empty block
r++
case path[r] == '.' && (r+1 == n || os.IsPathSeparator(path[r+1])):
// /./
r++
case r+1 < n && path[r] == '.' && path[r+1] == '.' && (r+2 == n || os.IsPathSeparator(path[r+2])):
// /../ is currently unhandled
return path
default:
pathbuf[w] = '\\'
w++
for ; r < n && !os.IsPathSeparator(path[r]); r++ {
pathbuf[w] = path[r]
w++
}
}
}
// A drive's root directory needs a trailing \
if w == len(`\\?\c:`) {
pathbuf[w] = '\\'
w++
}
return string(pathbuf[:w])
}
// +build darwin freebsd // +build darwin freebsd openbsd
/* /*
Copyright The containerd Authors. Copyright The containerd Authors.
......
...@@ -20,7 +20,6 @@ package sysx ...@@ -20,7 +20,6 @@ package sysx
import ( import (
"bytes" "bytes"
"syscall"
"golang.org/x/sys/unix" "golang.org/x/sys/unix"
) )
...@@ -66,60 +65,53 @@ func LGetxattr(path, attr string) ([]byte, error) { ...@@ -66,60 +65,53 @@ func LGetxattr(path, attr string) ([]byte, error) {
return getxattrAll(path, attr, unix.Lgetxattr) return getxattrAll(path, attr, unix.Lgetxattr)
} }
const defaultXattrBufferSize = 5 const defaultXattrBufferSize = 128
type listxattrFunc func(path string, dest []byte) (int, error) type listxattrFunc func(path string, dest []byte) (int, error)
func listxattrAll(path string, listFunc listxattrFunc) ([]string, error) { func listxattrAll(path string, listFunc listxattrFunc) ([]string, error) {
var p []byte // nil on first execution buf := make([]byte, defaultXattrBufferSize)
n, err := listFunc(path, buf)
for { for err == unix.ERANGE {
n, err := listFunc(path, p) // first call gets buffer size. // Buffer too small, use zero-sized buffer to get the actual size
n, err = listFunc(path, []byte{})
if err != nil { if err != nil {
return nil, err return nil, err
} }
buf = make([]byte, n)
n, err = listFunc(path, buf)
}
if err != nil {
return nil, err
}
if n > len(p) { ps := bytes.Split(bytes.TrimSuffix(buf[:n], []byte{0}), []byte{0})
p = make([]byte, n) var entries []string
continue for _, p := range ps {
} if len(p) > 0 {
entries = append(entries, string(p))
p = p[:n]
ps := bytes.Split(bytes.TrimSuffix(p, []byte{0}), []byte{0})
var entries []string
for _, p := range ps {
s := string(p)
if s != "" {
entries = append(entries, s)
}
} }
return entries, nil
} }
return entries, nil
} }
type getxattrFunc func(string, string, []byte) (int, error) type getxattrFunc func(string, string, []byte) (int, error)
func getxattrAll(path, attr string, getFunc getxattrFunc) ([]byte, error) { func getxattrAll(path, attr string, getFunc getxattrFunc) ([]byte, error) {
p := make([]byte, defaultXattrBufferSize) buf := make([]byte, defaultXattrBufferSize)
for { n, err := getFunc(path, attr, buf)
n, err := getFunc(path, attr, p) for err == unix.ERANGE {
// Buffer too small, use zero-sized buffer to get the actual size
n, err = getFunc(path, attr, []byte{})
if err != nil { if err != nil {
if errno, ok := err.(syscall.Errno); ok && errno == syscall.ERANGE {
p = make([]byte, len(p)*2) // this can't be ideal.
continue // try again!
}
return nil, err return nil, err
} }
buf = make([]byte, n)
// realloc to correct size and repeat n, err = getFunc(path, attr, buf)
if n > len(p) { }
p = make([]byte, n) if err != nil {
continue return nil, err
}
return p[:n], nil
} }
return buf[:n], nil
} }
...@@ -23,7 +23,7 @@ import ( ...@@ -23,7 +23,7 @@ import (
"runtime" "runtime"
) )
var unsupported = errors.New("extended attributes unsupported on " + runtime.GOOS) var errUnsupported = errors.New("extended attributes unsupported on " + runtime.GOOS)
// Listxattr calls syscall listxattr and reads all content // Listxattr calls syscall listxattr and reads all content
// and returns a string array // and returns a string array
...@@ -33,17 +33,17 @@ func Listxattr(path string) ([]string, error) { ...@@ -33,17 +33,17 @@ func Listxattr(path string) ([]string, error) {
// Removexattr calls syscall removexattr // Removexattr calls syscall removexattr
func Removexattr(path string, attr string) (err error) { func Removexattr(path string, attr string) (err error) {
return unsupported return errUnsupported
} }
// Setxattr calls syscall setxattr // Setxattr calls syscall setxattr
func Setxattr(path string, attr string, data []byte, flags int) (err error) { func Setxattr(path string, attr string, data []byte, flags int) (err error) {
return unsupported return errUnsupported
} }
// Getxattr calls syscall getxattr // Getxattr calls syscall getxattr
func Getxattr(path, attr string) ([]byte, error) { func Getxattr(path, attr string) ([]byte, error) {
return []byte{}, unsupported return []byte{}, errUnsupported
} }
// LListxattr lists xattrs, not following symlinks // LListxattr lists xattrs, not following symlinks
...@@ -53,12 +53,12 @@ func LListxattr(path string) ([]string, error) { ...@@ -53,12 +53,12 @@ func LListxattr(path string) ([]string, error) {
// LRemovexattr removes an xattr, not following symlinks // LRemovexattr removes an xattr, not following symlinks
func LRemovexattr(path string, attr string) (err error) { func LRemovexattr(path string, attr string) (err error) {
return unsupported return errUnsupported
} }
// LSetxattr sets an xattr, not following symlinks // LSetxattr sets an xattr, not following symlinks
func LSetxattr(path string, attr string, data []byte, flags int) (err error) { func LSetxattr(path string, attr string, data []byte, flags int) (err error) {
return unsupported return errUnsupported
} }
// LGetxattr gets an xattr, not following symlinks // LGetxattr gets an xattr, not following symlinks
......
bazil.org/fuse 371fbbdaa8987b715bdd21d6adc4c9b20155f748
github.com/dustin/go-humanize bb3d318650d48840a39aa21a027c6630e198e626
github.com/golang/protobuf 1e59b77b52bf8e4b449a57e6f79f21226d571845
github.com/inconshreveable/mousetrap 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75
github.com/opencontainers/go-digest 279bed98673dd5bef374d3b6e4b09e2af76183bf
github.com/pkg/errors f15c970de5b76fac0b59abb32d62c17cc7bed265
github.com/sirupsen/logrus 89742aefa4b206dcf400792f3bd35b542998eb3b
github.com/spf13/cobra 2da4a54c5ceefcee7ca5dd0eea1e18a3b6366489
github.com/spf13/pflag 4c012f6dcd9546820e378d0bdda4d8fc772cdfea
golang.org/x/crypto 9f005a07e0d31d45e6656d241bb5c0f2efd4bc94
golang.org/x/net a337091b0525af65de94df2eb7e98bd9962dcbe2
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
golang.org/x/sys 77b0e4315053a57ed2962443614bdb28db152054
...@@ -10,7 +10,7 @@ environment: ...@@ -10,7 +10,7 @@ environment:
CGO_ENABLED: 1 CGO_ENABLED: 1
GO111MODULE: off GO111MODULE: off
matrix: matrix:
- GO_VERSION: 1.13.15 - GO_VERSION: 1.15.5
install: install:
# Install Mingw # Install Mingw
......
...@@ -46,7 +46,7 @@ See [test dashboard](https://k8s-testgrid.appspot.com/sig-node-containerd) ...@@ -46,7 +46,7 @@ See [test dashboard](https://k8s-testgrid.appspot.com/sig-node-containerd)
| End-Of-Life | v1.1 (End-Of-Life) | 1.10+ | v1alpha2 | | End-Of-Life | v1.1 (End-Of-Life) | 1.10+ | v1alpha2 |
| | v1.2 (Extended) | 1.10+ | v1alpha2 | | | v1.2 (Extended) | 1.10+ | v1alpha2 |
| | v1.3 | 1.12+ | v1alpha2 | | | v1.3 | 1.12+ | v1alpha2 |
| | v1.4 | 1.19+ (rc) | v1alpha2 | | | v1.4 | 1.19+ | v1alpha2 |
**Note:** The support table above specifies the Kubernetes Version that was supported at time of release of the containerd - cri integration. **Note:** The support table above specifies the Kubernetes Version that was supported at time of release of the containerd - cri integration.
...@@ -56,7 +56,7 @@ The following is the current support table for containerd CRI integration taking ...@@ -56,7 +56,7 @@ The following is the current support table for containerd CRI integration taking
|:------------------:|:------------------:|:-----------:| |:------------------:|:------------------:|:-----------:|
| v1.2 | 1.15+ | v1alpha2 | | v1.2 | 1.15+ | v1alpha2 |
| v1.3 | 1.15+ | v1alpha2 | | v1.3 | 1.15+ | v1alpha2 |
| v1.4 | 1.19+ (rc) | v1alpha2 | | v1.4 | 1.19+ | v1alpha2 |
## Production Quality Cluster on GCE ## Production Quality Cluster on GCE
For a production quality cluster on GCE brought up with `kube-up.sh` refer [here](docs/kube-up.md). For a production quality cluster on GCE brought up with `kube-up.sh` refer [here](docs/kube-up.md).
...@@ -88,7 +88,7 @@ specifications as appropriate. ...@@ -88,7 +88,7 @@ specifications as appropriate.
backport version of `libseccomp-dev` is required. See [travis.yml](.travis.yml) for an example on trusty. backport version of `libseccomp-dev` is required. See [travis.yml](.travis.yml) for an example on trusty.
* **btrfs development library.** Required by containerd btrfs support. `btrfs-tools`(Ubuntu, Debian) / `btrfs-progs-devel`(Fedora, CentOS, RHEL) * **btrfs development library.** Required by containerd btrfs support. `btrfs-tools`(Ubuntu, Debian) / `btrfs-progs-devel`(Fedora, CentOS, RHEL)
2. Install **`pkg-config`** (required for linking with `libseccomp`). 2. Install **`pkg-config`** (required for linking with `libseccomp`).
3. Install and setup a Go 1.13.15 development environment. 3. Install and setup a Go 1.15.5 development environment.
4. Make a local clone of this repository. 4. Make a local clone of this repository.
5. Install binary dependencies by running the following command from your cloned `cri/` project directory: 5. Install binary dependencies by running the following command from your cloned `cri/` project directory:
```bash ```bash
......
...@@ -16,26 +16,18 @@ ...@@ -16,26 +16,18 @@
// Code generated by protoc-gen-gogo. DO NOT EDIT. // Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: api.proto // source: api.proto
/*
Package cri_runtimeoptions_v1 is a generated protocol buffer package.
It is generated from these files:
api.proto
It has these top-level messages:
Options
*/
package cri_runtimeoptions_v1 package cri_runtimeoptions_v1
import proto "github.com/gogo/protobuf/proto" import (
import fmt "fmt" fmt "fmt"
import math "math" _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto"
io "io"
import strings "strings" math "math"
import reflect "reflect" math_bits "math/bits"
reflect "reflect"
import io "io" strings "strings"
)
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
...@@ -46,19 +38,49 @@ var _ = math.Inf ...@@ -46,19 +38,49 @@ var _ = math.Inf
// is compatible with the proto package it is being compiled against. // is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the // A compilation error at this line likely means your copy of the
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
type Options struct { type Options struct {
// TypeUrl specifies the type of the content inside the config file. // TypeUrl specifies the type of the content inside the config file.
TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"` TypeUrl string `protobuf:"bytes,1,opt,name=type_url,json=typeUrl,proto3" json:"type_url,omitempty"`
// ConfigPath specifies the filesystem location of the config file // ConfigPath specifies the filesystem location of the config file
// used by the runtime. // used by the runtime.
ConfigPath string `protobuf:"bytes,2,opt,name=config_path,json=configPath,proto3" json:"config_path,omitempty"` ConfigPath string `protobuf:"bytes,2,opt,name=config_path,json=configPath,proto3" json:"config_path,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *Options) Reset() { *m = Options{} }
func (*Options) ProtoMessage() {}
func (*Options) Descriptor() ([]byte, []int) {
return fileDescriptor_00212fb1f9d3bf1c, []int{0}
}
func (m *Options) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Options.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Options) XXX_Merge(src proto.Message) {
xxx_messageInfo_Options.Merge(m, src)
}
func (m *Options) XXX_Size() int {
return m.Size()
}
func (m *Options) XXX_DiscardUnknown() {
xxx_messageInfo_Options.DiscardUnknown(m)
} }
func (m *Options) Reset() { *m = Options{} } var xxx_messageInfo_Options proto.InternalMessageInfo
func (*Options) ProtoMessage() {}
func (*Options) Descriptor() ([]byte, []int) { return fileDescriptorApi, []int{0} }
func (m *Options) GetTypeUrl() string { func (m *Options) GetTypeUrl() string {
if m != nil { if m != nil {
...@@ -77,10 +99,29 @@ func (m *Options) GetConfigPath() string { ...@@ -77,10 +99,29 @@ func (m *Options) GetConfigPath() string {
func init() { func init() {
proto.RegisterType((*Options)(nil), "cri.runtimeoptions.v1.Options") proto.RegisterType((*Options)(nil), "cri.runtimeoptions.v1.Options")
} }
func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) }
var fileDescriptor_00212fb1f9d3bf1c = []byte{
// 183 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4,
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4d, 0x2e, 0xca, 0xd4, 0x2b, 0x2a, 0xcd, 0x2b, 0xc9,
0xcc, 0x4d, 0xcd, 0x2f, 0x28, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x33, 0x94, 0xd2, 0x4d, 0xcf,
0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0xab,
0x4e, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0x62, 0x8a, 0x92, 0x2b, 0x17, 0xbb, 0x3f,
0x44, 0xb3, 0x90, 0x24, 0x17, 0x47, 0x49, 0x65, 0x41, 0x6a, 0x7c, 0x69, 0x51, 0x8e, 0x04, 0xa3,
0x02, 0xa3, 0x06, 0x67, 0x10, 0x3b, 0x88, 0x1f, 0x5a, 0x94, 0x23, 0x24, 0xcf, 0xc5, 0x9d, 0x9c,
0x9f, 0x97, 0x96, 0x99, 0x1e, 0x5f, 0x90, 0x58, 0x92, 0x21, 0xc1, 0x04, 0x96, 0xe5, 0x82, 0x08,
0x05, 0x24, 0x96, 0x64, 0x38, 0xc9, 0x9c, 0x78, 0x28, 0xc7, 0x78, 0xe3, 0xa1, 0x1c, 0x43, 0xc3,
0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71,
0xc2, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x5d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07,
0x00, 0xf2, 0x18, 0xbe, 0x00, 0x00, 0x00,
}
func (m *Options) Marshal() (dAtA []byte, err error) { func (m *Options) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA) n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil { if err != nil {
return nil, err return nil, err
} }
...@@ -88,35 +129,47 @@ func (m *Options) Marshal() (dAtA []byte, err error) { ...@@ -88,35 +129,47 @@ func (m *Options) Marshal() (dAtA []byte, err error) {
} }
func (m *Options) MarshalTo(dAtA []byte) (int, error) { func (m *Options) MarshalTo(dAtA []byte) (int, error) {
var i int size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.TypeUrl) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintApi(dAtA, i, uint64(len(m.TypeUrl)))
i += copy(dAtA[i:], m.TypeUrl)
}
if len(m.ConfigPath) > 0 { if len(m.ConfigPath) > 0 {
dAtA[i] = 0x12 i -= len(m.ConfigPath)
i++ copy(dAtA[i:], m.ConfigPath)
i = encodeVarintApi(dAtA, i, uint64(len(m.ConfigPath))) i = encodeVarintApi(dAtA, i, uint64(len(m.ConfigPath)))
i += copy(dAtA[i:], m.ConfigPath) i--
dAtA[i] = 0x12
}
if len(m.TypeUrl) > 0 {
i -= len(m.TypeUrl)
copy(dAtA[i:], m.TypeUrl)
i = encodeVarintApi(dAtA, i, uint64(len(m.TypeUrl)))
i--
dAtA[i] = 0xa
} }
return i, nil return len(dAtA) - i, nil
} }
func encodeVarintApi(dAtA []byte, offset int, v uint64) int { func encodeVarintApi(dAtA []byte, offset int, v uint64) int {
offset -= sovApi(v)
base := offset
for v >= 1<<7 { for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80) dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7 v >>= 7
offset++ offset++
} }
dAtA[offset] = uint8(v) dAtA[offset] = uint8(v)
return offset + 1 return base
} }
func (m *Options) Size() (n int) { func (m *Options) Size() (n int) {
if m == nil {
return 0
}
var l int var l int
_ = l _ = l
l = len(m.TypeUrl) l = len(m.TypeUrl)
...@@ -131,14 +184,7 @@ func (m *Options) Size() (n int) { ...@@ -131,14 +184,7 @@ func (m *Options) Size() (n int) {
} }
func sovApi(x uint64) (n int) { func sovApi(x uint64) (n int) {
for { return (math_bits.Len64(x|1) + 6) / 7
n++
x >>= 7
if x == 0 {
break
}
}
return n
} }
func sozApi(x uint64) (n int) { func sozApi(x uint64) (n int) {
return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63)))) return sovApi(uint64((x << 1) ^ uint64((int64(x) >> 63))))
...@@ -177,7 +223,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -177,7 +223,7 @@ func (m *Options) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
wire |= (uint64(b) & 0x7F) << shift wire |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
...@@ -205,7 +251,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -205,7 +251,7 @@ func (m *Options) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift stringLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
...@@ -215,6 +261,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -215,6 +261,9 @@ func (m *Options) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthApi return ErrInvalidLengthApi
} }
postIndex := iNdEx + intStringLen postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthApi
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
...@@ -234,7 +283,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -234,7 +283,7 @@ func (m *Options) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
iNdEx++ iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift stringLen |= uint64(b&0x7F) << shift
if b < 0x80 { if b < 0x80 {
break break
} }
...@@ -244,6 +293,9 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -244,6 +293,9 @@ func (m *Options) Unmarshal(dAtA []byte) error {
return ErrInvalidLengthApi return ErrInvalidLengthApi
} }
postIndex := iNdEx + intStringLen postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthApi
}
if postIndex > l { if postIndex > l {
return io.ErrUnexpectedEOF return io.ErrUnexpectedEOF
} }
...@@ -255,7 +307,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -255,7 +307,7 @@ func (m *Options) Unmarshal(dAtA []byte) error {
if err != nil { if err != nil {
return err return err
} }
if skippy < 0 { if (skippy < 0) || (iNdEx+skippy) < 0 {
return ErrInvalidLengthApi return ErrInvalidLengthApi
} }
if (iNdEx + skippy) > l { if (iNdEx + skippy) > l {
...@@ -273,6 +325,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { ...@@ -273,6 +325,7 @@ func (m *Options) Unmarshal(dAtA []byte) error {
func skipApi(dAtA []byte) (n int, err error) { func skipApi(dAtA []byte) (n int, err error) {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
depth := 0
for iNdEx < l { for iNdEx < l {
var wire uint64 var wire uint64
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
...@@ -304,10 +357,8 @@ func skipApi(dAtA []byte) (n int, err error) { ...@@ -304,10 +357,8 @@ func skipApi(dAtA []byte) (n int, err error) {
break break
} }
} }
return iNdEx, nil
case 1: case 1:
iNdEx += 8 iNdEx += 8
return iNdEx, nil
case 2: case 2:
var length int var length int
for shift := uint(0); ; shift += 7 { for shift := uint(0); ; shift += 7 {
...@@ -324,71 +375,34 @@ func skipApi(dAtA []byte) (n int, err error) { ...@@ -324,71 +375,34 @@ func skipApi(dAtA []byte) (n int, err error) {
break break
} }
} }
iNdEx += length
if length < 0 { if length < 0 {
return 0, ErrInvalidLengthApi return 0, ErrInvalidLengthApi
} }
return iNdEx, nil iNdEx += length
case 3: case 3:
for { depth++
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowApi
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipApi(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4: case 4:
return iNdEx, nil if depth == 0 {
return 0, ErrUnexpectedEndOfGroupApi
}
depth--
case 5: case 5:
iNdEx += 4 iNdEx += 4
return iNdEx, nil
default: default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType) return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
} }
if iNdEx < 0 {
return 0, ErrInvalidLengthApi
}
if depth == 0 {
return iNdEx, nil
}
} }
panic("unreachable") return 0, io.ErrUnexpectedEOF
} }
var ( var (
ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling") ErrInvalidLengthApi = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowApi = fmt.Errorf("proto: integer overflow") ErrIntOverflowApi = fmt.Errorf("proto: integer overflow")
ErrUnexpectedEndOfGroupApi = fmt.Errorf("proto: unexpected end of group")
) )
func init() { proto.RegisterFile("api.proto", fileDescriptorApi) }
var fileDescriptorApi = []byte{
// 183 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4,
0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4d, 0x2e, 0xca, 0xd4, 0x2b, 0x2a, 0xcd, 0x2b, 0xc9,
0xcc, 0x4d, 0xcd, 0x2f, 0x28, 0xc9, 0xcc, 0xcf, 0x2b, 0xd6, 0x2b, 0x33, 0x94, 0xd2, 0x4d, 0xcf,
0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 0x4f, 0xcf, 0xd7, 0x07, 0xab,
0x4e, 0x2a, 0x4d, 0x03, 0xf3, 0xc0, 0x1c, 0x30, 0x0b, 0x62, 0x8a, 0x92, 0x2b, 0x17, 0xbb, 0x3f,
0x44, 0xb3, 0x90, 0x24, 0x17, 0x47, 0x49, 0x65, 0x41, 0x6a, 0x7c, 0x69, 0x51, 0x8e, 0x04, 0xa3,
0x02, 0xa3, 0x06, 0x67, 0x10, 0x3b, 0x88, 0x1f, 0x5a, 0x94, 0x23, 0x24, 0xcf, 0xc5, 0x9d, 0x9c,
0x9f, 0x97, 0x96, 0x99, 0x1e, 0x5f, 0x90, 0x58, 0x92, 0x21, 0xc1, 0x04, 0x96, 0xe5, 0x82, 0x08,
0x05, 0x24, 0x96, 0x64, 0x38, 0xc9, 0x9c, 0x78, 0x28, 0xc7, 0x78, 0xe3, 0xa1, 0x1c, 0x43, 0xc3,
0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71,
0xc2, 0x63, 0x39, 0x86, 0x24, 0x36, 0xb0, 0x5d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x07,
0x00, 0xf2, 0x18, 0xbe, 0x00, 0x00, 0x00,
}
...@@ -18,6 +18,7 @@ package config ...@@ -18,6 +18,7 @@ package config
import ( import (
"context" "context"
"net/url"
"time" "time"
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
...@@ -118,6 +119,23 @@ type Mirror struct { ...@@ -118,6 +119,23 @@ type Mirror struct {
// with host specified. // with host specified.
// The scheme, host and path from the endpoint URL will be used. // The scheme, host and path from the endpoint URL will be used.
Endpoints []string `toml:"endpoint" json:"endpoint"` Endpoints []string `toml:"endpoint" json:"endpoint"`
// Rewrites are repository rewrite rules for a namespace. When fetching image resources
// from an endpoint and a key matches the repository via regular expression matching
// it will be replaced with the corresponding value from the map in the resource request.
//
// This example configures CRI to pull docker.io/library/* images from docker.io/my-org/*:
//
// [plugins]
// [plugins."io.containerd.grpc.v1.cri"]
// [plugins."io.containerd.grpc.v1.cri".registry]
// [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
// [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
// endpoint = ["https://registry-1.docker.io/v2"]
// [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io".rewrite]
// "^library/(.*)" = "my-org/$1"
//
Rewrites map[string]string `toml:"rewrite" json:"rewrite"`
} }
// AuthConfig contains the config related to authentication to a specific registry // AuthConfig contains the config related to authentication to a specific registry
...@@ -352,6 +370,15 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error { ...@@ -352,6 +370,15 @@ func ValidatePluginConfig(ctx context.Context, c *PluginConfig) error {
c.Registry.Configs = make(map[string]RegistryConfig) c.Registry.Configs = make(map[string]RegistryConfig)
} }
for endpoint, auth := range c.Registry.Auths { for endpoint, auth := range c.Registry.Auths {
auth := auth
u, err := url.Parse(endpoint)
if err != nil {
return errors.Wrapf(err, "failed to parse registry url %q from `registry.auths`", endpoint)
}
if u.Scheme != "" {
// Do not include the scheme in the new registry config.
endpoint = u.Host
}
config := c.Registry.Configs[endpoint] config := c.Registry.Configs[endpoint]
config.Auth = &auth config.Auth = &auth
c.Registry.Configs[endpoint] = config c.Registry.Configs[endpoint] = config
......
...@@ -114,5 +114,5 @@ func copyExistingContents(source, destination string) error { ...@@ -114,5 +114,5 @@ func copyExistingContents(source, destination string) error {
if len(dstList) != 0 { if len(dstList) != 0 {
return errors.Errorf("volume at %q is not initially empty", destination) return errors.Errorf("volume at %q is not initially empty", destination)
} }
return fs.CopyDir(destination, source) return fs.CopyDir(destination, source, fs.WithXAttrExclude("security.selinux"))
} }
...@@ -147,7 +147,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3 ...@@ -147,7 +147,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3
// Apply envs from image config first, so that envs from container config // Apply envs from image config first, so that envs from container config
// can override them. // can override them.
env := imageConfig.Env env := append([]string{}, imageConfig.Env...)
for _, e := range config.GetEnvs() { for _, e := range config.GetEnvs() {
env = append(env, e.GetKey()+"="+e.GetValue()) env = append(env, e.GetKey()+"="+e.GetValue())
} }
......
...@@ -52,7 +52,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3 ...@@ -52,7 +52,7 @@ func (c *criService) containerSpec(id string, sandboxID string, sandboxPid uint3
// Apply envs from image config first, so that envs from container config // Apply envs from image config first, so that envs from container config
// can override them. // can override them.
env := imageConfig.Env env := append([]string{}, imageConfig.Env...)
for _, e := range config.GetEnvs() { for _, e := range config.GetEnvs() {
env = append(env, e.GetKey()+"="+e.GetValue()) env = append(env, e.GetKey()+"="+e.GetValue())
} }
......
...@@ -325,14 +325,11 @@ func handleContainerExit(ctx context.Context, e *eventtypes.TaskExit, cntr conta ...@@ -325,14 +325,11 @@ func handleContainerExit(ctx context.Context, e *eventtypes.TaskExit, cntr conta
} }
} }
err = cntr.Status.UpdateSync(func(status containerstore.Status) (containerstore.Status, error) { err = cntr.Status.UpdateSync(func(status containerstore.Status) (containerstore.Status, error) {
// If FinishedAt has been set (e.g. with start failure), keep as if status.FinishedAt == 0 {
// it is. status.Pid = 0
if status.FinishedAt != 0 { status.FinishedAt = e.ExitedAt.UnixNano()
return status, nil status.ExitCode = int32(e.ExitStatus)
} }
status.Pid = 0
status.FinishedAt = e.ExitedAt.UnixNano()
status.ExitCode = int32(e.ExitStatus)
// Unknown state can only transit to EXITED state, so we need // Unknown state can only transit to EXITED state, so we need
// to handle unknown state here. // to handle unknown state here.
if status.Unknown { if status.Unknown {
......
...@@ -151,6 +151,9 @@ func (c *criService) seccompEnabled() bool { ...@@ -151,6 +151,9 @@ func (c *criService) seccompEnabled() bool {
// openLogFile opens/creates a container log file. // openLogFile opens/creates a container log file.
func openLogFile(path string) (*os.File, error) { func openLogFile(path string) (*os.File, error) {
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
return nil, err
}
return os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0640) return os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0640)
} }
......
...@@ -31,6 +31,7 @@ import ( ...@@ -31,6 +31,7 @@ import (
"github.com/containerd/containerd" "github.com/containerd/containerd"
"github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/errdefs"
containerdimages "github.com/containerd/containerd/images" containerdimages "github.com/containerd/containerd/images"
"github.com/containerd/containerd/labels"
"github.com/containerd/containerd/log" "github.com/containerd/containerd/log"
distribution "github.com/containerd/containerd/reference/docker" distribution "github.com/containerd/containerd/reference/docker"
"github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/remotes/docker"
...@@ -319,6 +320,10 @@ func (c *criService) registryHosts(auth *runtime.AuthConfig) docker.RegistryHost ...@@ -319,6 +320,10 @@ func (c *criService) registryHosts(auth *runtime.AuthConfig) docker.RegistryHost
if err != nil { if err != nil {
return nil, errors.Wrap(err, "get registry endpoints") return nil, errors.Wrap(err, "get registry endpoints")
} }
rewrites, err := c.registryRewrites(host)
if err != nil {
return nil, errors.Wrap(err, "get registry rewrites")
}
for _, e := range endpoints { for _, e := range endpoints {
u, err := url.Parse(e) u, err := url.Parse(e)
if err != nil { if err != nil {
...@@ -357,6 +362,7 @@ func (c *criService) registryHosts(auth *runtime.AuthConfig) docker.RegistryHost ...@@ -357,6 +362,7 @@ func (c *criService) registryHosts(auth *runtime.AuthConfig) docker.RegistryHost
Scheme: u.Scheme, Scheme: u.Scheme,
Path: u.Path, Path: u.Path,
Capabilities: docker.HostCapabilityResolve | docker.HostCapabilityPull, Capabilities: docker.HostCapabilityResolve | docker.HostCapabilityPull,
Rewrites: rewrites,
}) })
} }
return registries, nil return registries, nil
...@@ -422,6 +428,20 @@ func (c *criService) registryEndpoints(host string) ([]string, error) { ...@@ -422,6 +428,20 @@ func (c *criService) registryEndpoints(host string) ([]string, error) {
return append(endpoints, defaultScheme(defaultHost)+"://"+defaultHost), nil return append(endpoints, defaultScheme(defaultHost)+"://"+defaultHost), nil
} }
func (c *criService) registryRewrites(host string) (map[string]string, error) {
var rewrites map[string]string
_, ok := c.config.Registry.Mirrors[host]
if ok {
rewrites = c.config.Registry.Mirrors[host].Rewrites
} else {
rewrites = c.config.Registry.Mirrors["*"].Rewrites
}
if rewrites == nil {
rewrites = map[string]string{}
}
return rewrites, nil
}
// newTransport returns a new HTTP transport used to pull image. // newTransport returns a new HTTP transport used to pull image.
// TODO(random-liu): Create a library and share this code with `ctr`. // TODO(random-liu): Create a library and share this code with `ctr`.
func newTransport() *http.Transport { func newTransport() *http.Transport {
...@@ -455,18 +475,21 @@ const ( ...@@ -455,18 +475,21 @@ const (
// targetRefLabel is a label which contains image reference and will be passed // targetRefLabel is a label which contains image reference and will be passed
// to snapshotters. // to snapshotters.
targetRefLabel = "containerd.io/snapshot/cri.image-ref" targetRefLabel = "containerd.io/snapshot/cri.image-ref"
// targetDigestLabel is a label which contains layer digest and will be passed // targetManifestDigestLabel is a label which contains manifest digest and will be passed
// to snapshotters.
targetManifestDigestLabel = "containerd.io/snapshot/cri.manifest-digest"
// targetLayerDigestLabel is a label which contains layer digest and will be passed
// to snapshotters. // to snapshotters.
targetDigestLabel = "containerd.io/snapshot/cri.layer-digest" targetLayerDigestLabel = "containerd.io/snapshot/cri.layer-digest"
// targetImageLayersLabel is a label which contains layer digests contained in // targetImageLayersLabel is a label which contains layer digests contained in
// the target image and will be passed to snapshotters for preparing layers in // the target image and will be passed to snapshotters for preparing layers in
// parallel. // parallel. Skipping some layers is allowed and only affects performance.
targetImageLayersLabel = "containerd.io/snapshot/cri.image-layers" targetImageLayersLabel = "containerd.io/snapshot/cri.image-layers"
) )
// appendInfoHandlerWrapper makes a handler which appends some basic information // appendInfoHandlerWrapper makes a handler which appends some basic information
// of images to each layer descriptor as annotations during unpack. These // of images like digests for manifest and their child layers as annotations during unpack.
// annotations will be passed to snapshotters as labels. These labels will be // These annotations will be passed to snapshotters as labels. These labels will be
// used mainly by stargz-based snapshotters for querying image contents from the // used mainly by stargz-based snapshotters for querying image contents from the
// registry. // registry.
func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) containerdimages.Handler { func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) containerdimages.Handler {
...@@ -478,15 +501,6 @@ func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) conta ...@@ -478,15 +501,6 @@ func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) conta
} }
switch desc.MediaType { switch desc.MediaType {
case imagespec.MediaTypeImageManifest, containerdimages.MediaTypeDockerSchema2Manifest: case imagespec.MediaTypeImageManifest, containerdimages.MediaTypeDockerSchema2Manifest:
var layers string
for _, c := range children {
if containerdimages.IsLayerType(c.MediaType) {
layers += fmt.Sprintf("%s,", c.Digest.String())
}
}
if len(layers) >= 1 {
layers = layers[:len(layers)-1]
}
for i := range children { for i := range children {
c := &children[i] c := &children[i]
if containerdimages.IsLayerType(c.MediaType) { if containerdimages.IsLayerType(c.MediaType) {
...@@ -494,8 +508,9 @@ func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) conta ...@@ -494,8 +508,9 @@ func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) conta
c.Annotations = make(map[string]string) c.Annotations = make(map[string]string)
} }
c.Annotations[targetRefLabel] = ref c.Annotations[targetRefLabel] = ref
c.Annotations[targetDigestLabel] = c.Digest.String() c.Annotations[targetLayerDigestLabel] = c.Digest.String()
c.Annotations[targetImageLayersLabel] = layers c.Annotations[targetImageLayersLabel] = getLayers(ctx, targetImageLayersLabel, children[i:], labels.Validate)
c.Annotations[targetManifestDigestLabel] = desc.Digest.String()
} }
} }
} }
...@@ -503,3 +518,25 @@ func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) conta ...@@ -503,3 +518,25 @@ func appendInfoHandlerWrapper(ref string) func(f containerdimages.Handler) conta
}) })
} }
} }
// getLayers returns comma-separated digests based on the passed list of
// descriptors. The returned list contains as many digests as possible as well
// as meets the label validation.
func getLayers(ctx context.Context, key string, descs []imagespec.Descriptor, validate func(k, v string) error) (layers string) {
var item string
for _, l := range descs {
if containerdimages.IsLayerType(l.MediaType) {
item = l.Digest.String()
if layers != "" {
item = "," + item
}
// This avoids the label hits the size limitation.
if err := validate(key, layers+item); err != nil {
log.G(ctx).WithError(err).WithField("label", key).Debugf("%q is omitted in the layers list", l.Digest.String())
break
}
layers += item
}
}
return
}
...@@ -10,8 +10,8 @@ github.com/BurntSushi/toml v0.3.1 ...@@ -10,8 +10,8 @@ github.com/BurntSushi/toml v0.3.1
github.com/cespare/xxhash/v2 v2.1.1 github.com/cespare/xxhash/v2 v2.1.1
github.com/containerd/cgroups 318312a373405e5e91134d8063d04d59768a1bff github.com/containerd/cgroups 318312a373405e5e91134d8063d04d59768a1bff
github.com/containerd/console v1.0.0 github.com/containerd/console v1.0.0
github.com/containerd/containerd v1.4.1 github.com/containerd/containerd c35d6975c66d1e33bc0bf5af4ed549393e5cb866 https://github.com/k3s-io/containerd.git
github.com/containerd/continuity efbc4488d8fe1bdc16bde3b2d2990d9b3a899165 github.com/containerd/continuity f93269e0d5c1e116e1c7f1f5af80eae9a75f988b https://github.com/k3s-io/continuity.git
github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf github.com/containerd/fifo f15a3290365b9d2627d189e619ab4008e0069caf
github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c github.com/containerd/go-runc 7016d3ce2328dd2cb1192b2076ebd565c4e8df0c
github.com/containerd/ttrpc v1.0.1 github.com/containerd/ttrpc v1.0.1
...@@ -23,7 +23,7 @@ github.com/docker/go-metrics v0.0.1 ...@@ -23,7 +23,7 @@ github.com/docker/go-metrics v0.0.1
github.com/docker/go-units v0.4.0 github.com/docker/go-units v0.4.0
github.com/godbus/dbus/v5 v5.0.3 github.com/godbus/dbus/v5 v5.0.3
github.com/gogo/googleapis v1.3.2 github.com/gogo/googleapis v1.3.2
github.com/gogo/protobuf v1.3.1 github.com/gogo/protobuf v1.3.2
github.com/golang/protobuf v1.3.5 github.com/golang/protobuf v1.3.5
github.com/google/uuid v1.1.1 github.com/google/uuid v1.1.1
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
...@@ -77,12 +77,12 @@ golang.org/x/oauth2 858c2ad4c8b6c5d10852cb89079f ...@@ -77,12 +77,12 @@ golang.org/x/oauth2 858c2ad4c8b6c5d10852cb89079f
golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82 golang.org/x/time 555d28b269f0569763d25dbe1a237ae74c6bcc82
gopkg.in/inf.v0 v0.9.1 gopkg.in/inf.v0 v0.9.1
gopkg.in/yaml.v2 v2.2.8 gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.19.2 k8s.io/api v0.19.4
k8s.io/apiserver v0.19.2 k8s.io/apiserver v0.19.4
k8s.io/apimachinery v0.19.2 k8s.io/apimachinery v0.19.4
k8s.io/client-go v0.19.2 k8s.io/client-go v0.19.4
k8s.io/component-base v0.19.2 k8s.io/component-base v0.19.4
k8s.io/cri-api v0.19.2 k8s.io/cri-api v0.19.4
k8s.io/klog/v2 v2.2.0 k8s.io/klog/v2 v2.2.0
k8s.io/utils d5654de09c73da55eb19ae4ab4f734f7a61747a6 k8s.io/utils d5654de09c73da55eb19ae4ab4f734f7a61747a6
sigs.k8s.io/structured-merge-diff/v4 v4.0.1 sigs.k8s.io/structured-merge-diff/v4 v4.0.1
......
(The MIT License)
Copyright (c) 2017 marvin + konsorten GmbH (open-source@konsorten.de)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Windows Terminal Sequences
This library allow for enabling Windows terminal color support for Go.
See [Console Virtual Terminal Sequences](https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences) for details.
## Usage
```go
import (
"syscall"
sequences "github.com/konsorten/go-windows-terminal-sequences"
)
func main() {
sequences.EnableVirtualTerminalProcessing(syscall.Stdout, true)
}
```
## Authors
The tool is sponsored by the [marvin + konsorten GmbH](http://www.konsorten.de).
We thank all the authors who provided code to this library:
* Felix Kollmann
* Nicolas Perraut
* @dirty49374
## License
(The MIT License)
Copyright (c) 2018 marvin + konsorten GmbH (open-source@konsorten.de)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
module github.com/konsorten/go-windows-terminal-sequences
// +build windows
package sequences
import (
"syscall"
)
var (
kernel32Dll *syscall.LazyDLL = syscall.NewLazyDLL("Kernel32.dll")
setConsoleMode *syscall.LazyProc = kernel32Dll.NewProc("SetConsoleMode")
)
func EnableVirtualTerminalProcessing(stream syscall.Handle, enable bool) error {
const ENABLE_VIRTUAL_TERMINAL_PROCESSING uint32 = 0x4
var mode uint32
err := syscall.GetConsoleMode(syscall.Stdout, &mode)
if err != nil {
return err
}
if enable {
mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING
} else {
mode &^= ENABLE_VIRTUAL_TERMINAL_PROCESSING
}
ret, _, err := setConsoleMode.Call(uintptr(stream), uintptr(mode))
if ret == 0 {
return err
}
return nil
}
// +build linux darwin
package sequences
import (
"fmt"
)
func EnableVirtualTerminalProcessing(stream uintptr, enable bool) error {
return fmt.Errorf("windows only package")
}
package logrus
import (
"bytes"
"sync"
)
var (
bufferPool BufferPool
)
type BufferPool interface {
Put(*bytes.Buffer)
Get() *bytes.Buffer
}
type defaultPool struct {
pool *sync.Pool
}
func (p *defaultPool) Put(buf *bytes.Buffer) {
p.pool.Put(buf)
}
func (p *defaultPool) Get() *bytes.Buffer {
return p.pool.Get().(*bytes.Buffer)
}
func getBuffer() *bytes.Buffer {
return bufferPool.Get()
}
func putBuffer(buf *bytes.Buffer) {
buf.Reset()
bufferPool.Put(buf)
}
// SetBufferPool allows to replace the default logrus buffer pool
// to better meets the specific needs of an application.
func SetBufferPool(bp BufferPool) {
bufferPool = bp
}
func init() {
SetBufferPool(&defaultPool{
pool: &sync.Pool{
New: func() interface{} {
return new(bytes.Buffer)
},
},
})
}
...@@ -13,7 +13,6 @@ import ( ...@@ -13,7 +13,6 @@ import (
) )
var ( var (
bufferPool *sync.Pool
// qualified package name, cached at first use // qualified package name, cached at first use
logrusPackage string logrusPackage string
...@@ -31,12 +30,6 @@ const ( ...@@ -31,12 +30,6 @@ const (
) )
func init() { func init() {
bufferPool = &sync.Pool{
New: func() interface{} {
return new(bytes.Buffer)
},
}
// start at the bottom of the stack before the package-name cache is primed // start at the bottom of the stack before the package-name cache is primed
minimumCallerDepth = 1 minimumCallerDepth = 1
} }
...@@ -243,9 +236,12 @@ func (entry Entry) log(level Level, msg string) { ...@@ -243,9 +236,12 @@ func (entry Entry) log(level Level, msg string) {
entry.fireHooks() entry.fireHooks()
buffer = bufferPool.Get().(*bytes.Buffer) buffer = getBuffer()
defer func() {
entry.Buffer = nil
putBuffer(buffer)
}()
buffer.Reset() buffer.Reset()
defer bufferPool.Put(buffer)
entry.Buffer = buffer entry.Buffer = buffer
entry.write() entry.write()
......
...@@ -134,6 +134,51 @@ func Fatal(args ...interface{}) { ...@@ -134,6 +134,51 @@ func Fatal(args ...interface{}) {
std.Fatal(args...) std.Fatal(args...)
} }
// TraceFn logs a message from a func at level Trace on the standard logger.
func TraceFn(fn LogFunction) {
std.TraceFn(fn)
}
// DebugFn logs a message from a func at level Debug on the standard logger.
func DebugFn(fn LogFunction) {
std.DebugFn(fn)
}
// PrintFn logs a message from a func at level Info on the standard logger.
func PrintFn(fn LogFunction) {
std.PrintFn(fn)
}
// InfoFn logs a message from a func at level Info on the standard logger.
func InfoFn(fn LogFunction) {
std.InfoFn(fn)
}
// WarnFn logs a message from a func at level Warn on the standard logger.
func WarnFn(fn LogFunction) {
std.WarnFn(fn)
}
// WarningFn logs a message from a func at level Warn on the standard logger.
func WarningFn(fn LogFunction) {
std.WarningFn(fn)
}
// ErrorFn logs a message from a func at level Error on the standard logger.
func ErrorFn(fn LogFunction) {
std.ErrorFn(fn)
}
// PanicFn logs a message from a func at level Panic on the standard logger.
func PanicFn(fn LogFunction) {
std.PanicFn(fn)
}
// FatalFn logs a message from a func at level Fatal on the standard logger then the process will exit with status set to 1.
func FatalFn(fn LogFunction) {
std.FatalFn(fn)
}
// Tracef logs a message at level Trace on the standard logger. // Tracef logs a message at level Trace on the standard logger.
func Tracef(format string, args ...interface{}) { func Tracef(format string, args ...interface{}) {
std.Tracef(format, args...) std.Tracef(format, args...)
......
...@@ -2,10 +2,9 @@ module github.com/sirupsen/logrus ...@@ -2,10 +2,9 @@ module github.com/sirupsen/logrus
require ( require (
github.com/davecgh/go-spew v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3
github.com/pmezard/go-difflib v1.0.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.2.2 github.com/stretchr/testify v1.2.2
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
) )
go 1.13 go 1.13
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 h1:YyJpGZS1sBuBCzLAR1VEpK193GlqGZbnPFnPV/5Rsb4=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
...@@ -9,6 +9,11 @@ import ( ...@@ -9,6 +9,11 @@ import (
"time" "time"
) )
// LogFunction For big messages, it can be more efficient to pass a function
// and only call it if the log level is actually enables rather than
// generating the log message and then checking if the level is enabled
type LogFunction func()[]interface{}
type Logger struct { type Logger struct {
// The logs are `io.Copy`'d to this in a mutex. It's common to set this to a // The logs are `io.Copy`'d to this in a mutex. It's common to set this to a
// file, or leave it default which is `os.Stderr`. You can also set this to // file, or leave it default which is `os.Stderr`. You can also set this to
...@@ -70,7 +75,7 @@ func (mw *MutexWrap) Disable() { ...@@ -70,7 +75,7 @@ func (mw *MutexWrap) Disable() {
// //
// var log = &logrus.Logger{ // var log = &logrus.Logger{
// Out: os.Stderr, // Out: os.Stderr,
// Formatter: new(logrus.JSONFormatter), // Formatter: new(logrus.TextFormatter),
// Hooks: make(logrus.LevelHooks), // Hooks: make(logrus.LevelHooks),
// Level: logrus.DebugLevel, // Level: logrus.DebugLevel,
// } // }
...@@ -195,6 +200,14 @@ func (logger *Logger) Log(level Level, args ...interface{}) { ...@@ -195,6 +200,14 @@ func (logger *Logger) Log(level Level, args ...interface{}) {
} }
} }
func (logger *Logger) LogFn(level Level, fn LogFunction) {
if logger.IsLevelEnabled(level) {
entry := logger.newEntry()
entry.Log(level, fn()...)
logger.releaseEntry(entry)
}
}
func (logger *Logger) Trace(args ...interface{}) { func (logger *Logger) Trace(args ...interface{}) {
logger.Log(TraceLevel, args...) logger.Log(TraceLevel, args...)
} }
...@@ -234,6 +247,45 @@ func (logger *Logger) Panic(args ...interface{}) { ...@@ -234,6 +247,45 @@ func (logger *Logger) Panic(args ...interface{}) {
logger.Log(PanicLevel, args...) logger.Log(PanicLevel, args...)
} }
func (logger *Logger) TraceFn(fn LogFunction) {
logger.LogFn(TraceLevel, fn)
}
func (logger *Logger) DebugFn(fn LogFunction) {
logger.LogFn(DebugLevel, fn)
}
func (logger *Logger) InfoFn(fn LogFunction) {
logger.LogFn(InfoLevel, fn)
}
func (logger *Logger) PrintFn(fn LogFunction) {
entry := logger.newEntry()
entry.Print(fn()...)
logger.releaseEntry(entry)
}
func (logger *Logger) WarnFn(fn LogFunction) {
logger.LogFn(WarnLevel, fn)
}
func (logger *Logger) WarningFn(fn LogFunction) {
logger.WarnFn(fn)
}
func (logger *Logger) ErrorFn(fn LogFunction) {
logger.LogFn(ErrorLevel, fn)
}
func (logger *Logger) FatalFn(fn LogFunction) {
logger.LogFn(FatalLevel, fn)
logger.Exit(1)
}
func (logger *Logger) PanicFn(fn LogFunction) {
logger.LogFn(PanicLevel, fn)
}
func (logger *Logger) Logln(level Level, args ...interface{}) { func (logger *Logger) Logln(level Level, args ...interface{}) {
if logger.IsLevelEnabled(level) { if logger.IsLevelEnabled(level) {
entry := logger.newEntry() entry := logger.newEntry()
......
...@@ -5,30 +5,23 @@ package logrus ...@@ -5,30 +5,23 @@ package logrus
import ( import (
"io" "io"
"os" "os"
"syscall"
sequences "github.com/konsorten/go-windows-terminal-sequences" "golang.org/x/sys/windows"
) )
func initTerminal(w io.Writer) {
switch v := w.(type) {
case *os.File:
sequences.EnableVirtualTerminalProcessing(syscall.Handle(v.Fd()), true)
}
}
func checkIfTerminal(w io.Writer) bool { func checkIfTerminal(w io.Writer) bool {
var ret bool
switch v := w.(type) { switch v := w.(type) {
case *os.File: case *os.File:
handle := windows.Handle(v.Fd())
var mode uint32 var mode uint32
err := syscall.GetConsoleMode(syscall.Handle(v.Fd()), &mode) if err := windows.GetConsoleMode(handle, &mode); err != nil {
ret = (err == nil) return false
default: }
ret = false mode |= windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING
} if err := windows.SetConsoleMode(handle, mode); err != nil {
if ret { return false
initTerminal(w) }
return true
} }
return ret return false
} }
...@@ -162,14 +162,14 @@ github.com/cilium/ebpf/internal/btf ...@@ -162,14 +162,14 @@ github.com/cilium/ebpf/internal/btf
github.com/cilium/ebpf/internal/unix github.com/cilium/ebpf/internal/unix
# github.com/container-storage-interface/spec v1.2.0 # github.com/container-storage-interface/spec v1.2.0
github.com/container-storage-interface/spec/lib/go/csi github.com/container-storage-interface/spec/lib/go/csi
# github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340 => github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 # github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340 => github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340
github.com/containerd/cgroups github.com/containerd/cgroups
github.com/containerd/cgroups/stats/v1 github.com/containerd/cgroups/stats/v1
github.com/containerd/cgroups/v2 github.com/containerd/cgroups/v2
github.com/containerd/cgroups/v2/stats github.com/containerd/cgroups/v2/stats
# github.com/containerd/console v1.0.0 => github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 # github.com/containerd/console v1.0.0 => github.com/containerd/console v1.0.0
github.com/containerd/console github.com/containerd/console
# github.com/containerd/containerd v1.4.0 => github.com/k3s-io/containerd v1.4.3-k3s3 # github.com/containerd/containerd v1.4.4 => github.com/k3s-io/containerd v1.4.4-k3s1
## explicit ## explicit
github.com/containerd/containerd github.com/containerd/containerd
github.com/containerd/containerd/api/events github.com/containerd/containerd/api/events
...@@ -305,16 +305,15 @@ github.com/containerd/containerd/snapshots/storage ...@@ -305,16 +305,15 @@ github.com/containerd/containerd/snapshots/storage
github.com/containerd/containerd/sys github.com/containerd/containerd/sys
github.com/containerd/containerd/sys/reaper github.com/containerd/containerd/sys/reaper
github.com/containerd/containerd/version github.com/containerd/containerd/version
# github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe => github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 # github.com/containerd/continuity v0.0.0-20200710164510-efbc4488d8fe => github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1
github.com/containerd/continuity github.com/containerd/continuity
github.com/containerd/continuity/devices github.com/containerd/continuity/devices
github.com/containerd/continuity/driver github.com/containerd/continuity/driver
github.com/containerd/continuity/fs github.com/containerd/continuity/fs
github.com/containerd/continuity/pathdriver github.com/containerd/continuity/pathdriver
github.com/containerd/continuity/proto github.com/containerd/continuity/proto
github.com/containerd/continuity/syscallx
github.com/containerd/continuity/sysx github.com/containerd/continuity/sysx
# github.com/containerd/cri v1.11.1-0.20200820101445-b0cc07999aa5 => github.com/rancher/cri v1.4.0-k3s.2 # github.com/containerd/cri v1.11.1-0.20200820101445-b0cc07999aa5 => github.com/k3s-io/cri v1.4.0-k3s.5
## explicit ## explicit
github.com/containerd/cri github.com/containerd/cri
github.com/containerd/cri/pkg/annotations github.com/containerd/cri/pkg/annotations
...@@ -690,8 +689,6 @@ github.com/k3s-io/helm-controller/pkg/generated/listers/helm.cattle.io/v1 ...@@ -690,8 +689,6 @@ github.com/k3s-io/helm-controller/pkg/generated/listers/helm.cattle.io/v1
github.com/k3s-io/helm-controller/pkg/helm github.com/k3s-io/helm-controller/pkg/helm
# github.com/karrick/godirwalk v1.7.5 # github.com/karrick/godirwalk v1.7.5
github.com/karrick/godirwalk github.com/karrick/godirwalk
# github.com/konsorten/go-windows-terminal-sequences v1.0.3
github.com/konsorten/go-windows-terminal-sequences
# github.com/kubernetes-sigs/cri-tools v0.0.0-00010101000000-000000000000 => github.com/rancher/cri-tools v1.19.0-k3s1 # github.com/kubernetes-sigs/cri-tools v0.0.0-00010101000000-000000000000 => github.com/rancher/cri-tools v1.19.0-k3s1
## explicit ## explicit
github.com/kubernetes-sigs/cri-tools/cmd/crictl github.com/kubernetes-sigs/cri-tools/cmd/crictl
...@@ -934,7 +931,7 @@ github.com/satori/go.uuid ...@@ -934,7 +931,7 @@ github.com/satori/go.uuid
github.com/seccomp/libseccomp-golang github.com/seccomp/libseccomp-golang
# github.com/shurcooL/sanitized_anchor_name v1.0.0 # github.com/shurcooL/sanitized_anchor_name v1.0.0
github.com/shurcooL/sanitized_anchor_name github.com/shurcooL/sanitized_anchor_name
# github.com/sirupsen/logrus v1.6.0 # github.com/sirupsen/logrus v1.7.0
## explicit ## explicit
github.com/sirupsen/logrus github.com/sirupsen/logrus
# github.com/soheilhy/cmux v0.1.4 # github.com/soheilhy/cmux v0.1.4
...@@ -1175,7 +1172,7 @@ golang.org/x/oauth2/jwt ...@@ -1175,7 +1172,7 @@ golang.org/x/oauth2/jwt
golang.org/x/sync/errgroup golang.org/x/sync/errgroup
golang.org/x/sync/semaphore golang.org/x/sync/semaphore
golang.org/x/sync/singleflight golang.org/x/sync/singleflight
# golang.org/x/sys v0.0.0-20201112073958-5cba982894dd => golang.org/x/sys v0.0.0-20201112073958-5cba982894dd # golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3 => golang.org/x/sys v0.0.0-20201112073958-5cba982894dd
## explicit ## explicit
golang.org/x/sys/cpu golang.org/x/sys/cpu
golang.org/x/sys/internal/unsafeheader golang.org/x/sys/internal/unsafeheader
...@@ -2924,12 +2921,12 @@ sigs.k8s.io/yaml ...@@ -2924,12 +2921,12 @@ sigs.k8s.io/yaml
vbom.ml/util/sortorder vbom.ml/util/sortorder
# github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.9 # github.com/Microsoft/hcsshim => github.com/Microsoft/hcsshim v0.8.9
# github.com/benmoss/go-powershell => github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373 # github.com/benmoss/go-powershell => github.com/rancher/go-powershell v0.0.0-20200701184732-233247d45373
# github.com/containerd/btrfs => github.com/containerd/btrfs v0.0.0-20181101203652-af5082808c83 # github.com/containerd/btrfs => github.com/containerd/btrfs v0.0.0-20201111183144-404b9149801e
# github.com/containerd/cgroups => github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 # github.com/containerd/cgroups => github.com/containerd/cgroups v0.0.0-20200710171044-318312a37340
# github.com/containerd/console => github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50 # github.com/containerd/console => github.com/containerd/console v1.0.0
# github.com/containerd/containerd => github.com/k3s-io/containerd v1.4.3-k3s3 # github.com/containerd/containerd => github.com/k3s-io/containerd v1.4.4-k3s1
# github.com/containerd/continuity => github.com/containerd/continuity v0.0.0-20190815185530-f2a389ac0a02 # github.com/containerd/continuity => github.com/k3s-io/continuity v0.0.0-20210309170710-f93269e0d5c1
# github.com/containerd/cri => github.com/rancher/cri v1.4.0-k3s.2 # github.com/containerd/cri => github.com/k3s-io/cri v1.4.0-k3s.5
# github.com/containerd/fifo => github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c # github.com/containerd/fifo => github.com/containerd/fifo v0.0.0-20190816180239-bda0ff6ed73c
# github.com/containerd/go-runc => github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328 # github.com/containerd/go-runc => github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328
# github.com/containerd/typeurl => github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd # github.com/containerd/typeurl => github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment