From 6cd2094bc7c62c96c6ed209c729bcb71d47e8f99 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 19 Nov 2021 16:08:43 +0900 Subject: [PATCH 1/5] go.mod: Remove unneeded `replace()` Signed-off-by: Akihiro Suda --- go.mod | 3 --- go.sum | 26 ++++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index bb61304..9488285 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,3 @@ require ( github.com/sirupsen/logrus v1.8.1 google.golang.org/grpc v1.33.2 ) - -// replace grpc to match https://github.com/containerd/containerd/blob/v1.5.2/go.mod -replace google.golang.org/grpc => google.golang.org/grpc v1.27.1 diff --git a/go.sum b/go.sum index 51efd53..8755fd6 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,5 @@ bazil.org/fuse v0.0.0-20160811212531-371fbbdaa898/go.mod h1:Xbm+BRKSBEpa4q4hTSxohYNQpsxXPbPry4JJWOB3LB8= +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.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= @@ -97,6 +98,8 @@ github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLI github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/containerd/aufs v0.0.0-20200908144142-dab0cbea06f4/go.mod h1:nukgQABAEopAHvB6j7cnP5zJ+/3aVcE7hCYqvIwAHyE= github.com/containerd/aufs v0.0.0-20201003224125-76a6863f2989/go.mod h1:AkGGQs9NM2vtYHaUen+NljV0/baGCAPELGm2q9ZXpWU= @@ -236,7 +239,9 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= @@ -280,7 +285,6 @@ github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -617,6 +621,7 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -635,6 +640,7 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181011144130-49bb7cea24b1/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -683,6 +689,7 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -759,6 +766,7 @@ golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= @@ -808,6 +816,7 @@ google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsb google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= @@ -836,8 +845,21 @@ google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a h1:pOwg4OoaRYScjmR4LlLgdtnyoHYTSAVhhqe5uPdpII8= google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.23.1/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.24.0/go.mod h1:XDChyiUovWa60DnaeDeZmSW86xtLtjtZbwvSiRnRtcA= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 827598520174c0a25c43dac7f61bcca8c44fc5e8 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 19 Nov 2021 16:09:36 +0900 Subject: [PATCH 2/5] Apply gofmt (v1.17) Signed-off-by: Akihiro Suda --- check.go | 1 + fuseoverlayfs.go | 1 + fuseoverlayfs_test.go | 1 + plugin/plugin.go | 1 + 4 files changed, 4 insertions(+) diff --git a/check.go b/check.go index 9f3d16a..9cec584 100644 --- a/check.go +++ b/check.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/fuseoverlayfs.go b/fuseoverlayfs.go index dfaf5d2..344157c 100644 --- a/fuseoverlayfs.go +++ b/fuseoverlayfs.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/fuseoverlayfs_test.go b/fuseoverlayfs_test.go index 5a2ba3d..a4f026c 100644 --- a/fuseoverlayfs_test.go +++ b/fuseoverlayfs_test.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* diff --git a/plugin/plugin.go b/plugin/plugin.go index 2a76554..40256f9 100644 --- a/plugin/plugin.go +++ b/plugin/plugin.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux /* From d1b0d885c6ea9024cbcab1064dbb15cc08ff01fd Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 19 Nov 2021 16:10:34 +0900 Subject: [PATCH 3/5] Remove github.com/pkg/errors Signed-off-by: Akihiro Suda --- check.go | 7 +++---- fuseoverlayfs.go | 25 ++++++++++++------------- go.mod | 1 - 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/check.go b/check.go index 9cec584..6e8c9a7 100644 --- a/check.go +++ b/check.go @@ -28,7 +28,6 @@ import ( "github.com/containerd/containerd/log" "github.com/containerd/containerd/mount" - "github.com/pkg/errors" ) // supportsReadonlyMultipleLowerDir checks if read-only multiple lowerdirs can be mounted with fuse-overlayfs. @@ -58,7 +57,7 @@ func supportsReadonlyMultipleLowerDir(d string) error { } dest := filepath.Join(td, "merged") if err := m.Mount(dest); err != nil { - return errors.Wrapf(err, "failed to mount fuse-overlayfs (%+v) on %s", m, dest) + return fmt.Errorf("failed to mount fuse-overlayfs (%+v) on %s: %w", m, dest, err) } if err := mount.UnmountAll(dest, 0); err != nil { log.L.WithError(err).Warnf("Failed to unmount check directory %v", dest) @@ -71,13 +70,13 @@ func supportsReadonlyMultipleLowerDir(d string) error { // this snapshotter as a library. func Supported(root string) error { if _, err := exec.LookPath(fuseoverlayfsBinary); err != nil { - return errors.Wrapf(err, "%s not installed", fuseoverlayfsBinary) + return fmt.Errorf("%s not installed: %w", fuseoverlayfsBinary, err) } if err := os.MkdirAll(root, 0700); err != nil { return err } if err := supportsReadonlyMultipleLowerDir(root); err != nil { - return errors.Wrap(err, "fuse-overlayfs not functional, make sure running with kernel >= 4.18") + return fmt.Errorf("fuse-overlayfs not functional, make sure running with kernel >= 4.18: %w", err) } return nil } diff --git a/fuseoverlayfs.go b/fuseoverlayfs.go index 344157c..09211ca 100644 --- a/fuseoverlayfs.go +++ b/fuseoverlayfs.go @@ -33,7 +33,6 @@ import ( "github.com/containerd/containerd/snapshots" "github.com/containerd/containerd/snapshots/storage" "github.com/containerd/continuity/fs" - "github.com/pkg/errors" ) const ( @@ -187,7 +186,7 @@ func (o *snapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, er _, info, _, err := storage.GetInfo(ctx, key) t.Rollback() if err != nil { - return nil, errors.Wrap(err, "failed to get active mount") + return nil, fmt.Errorf("failed to get active mount: %w", err) } return o.mounts(s, info), nil } @@ -218,7 +217,7 @@ func (o *snapshotter) Commit(ctx context.Context, name, key string, opts ...snap } if _, err = storage.CommitActive(ctx, key, name, snapshots.Usage(usage), opts...); err != nil { - return errors.Wrap(err, "failed to commit snapshot") + return fmt.Errorf("failed to commit snapshot: %w", err) } return t.Commit() } @@ -241,14 +240,14 @@ func (o *snapshotter) Remove(ctx context.Context, key string) (err error) { _, _, err = storage.Remove(ctx, key) if err != nil { - return errors.Wrap(err, "failed to remove") + return fmt.Errorf("failed to remove: %w", err) } if !o.asyncRemove { var removals []string removals, err = o.getCleanupDirectories(ctx, t) if err != nil { - return errors.Wrap(err, "unable to get directories for removal") + return fmt.Errorf("unable to get directories for removal: %w", err) } // Remove directories after the transaction is closed, failures must not @@ -354,7 +353,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if path != "" { if err1 := os.RemoveAll(path); err1 != nil { log.G(ctx).WithError(err1).WithField("path", path).Error("failed to reclaim snapshot directory, directory may need removal") - err = errors.Wrapf(err, "failed to remove path: %v", err1) + err = fmt.Errorf("failed to remove path: %v: %w", err1, err) } } } @@ -366,7 +365,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return nil, errors.Wrap(err, "failed to create prepare snapshot dir") + return nil, fmt.Errorf("failed to create prepare snapshot dir: %w", err) } rollback := true defer func() { @@ -379,13 +378,13 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k s, err := storage.CreateSnapshot(ctx, kind, key, parent, opts...) if err != nil { - return nil, errors.Wrap(err, "failed to create snapshot") + return nil, fmt.Errorf("failed to create snapshot: %w", err) } if len(s.ParentIDs) > 0 { st, err := os.Stat(o.upperPath(s.ParentIDs[0])) if err != nil { - return nil, errors.Wrap(err, "failed to stat parent") + return nil, fmt.Errorf("failed to stat parent: %w", err) } stat := st.Sys().(*syscall.Stat_t) @@ -394,13 +393,13 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k if rerr := t.Rollback(); rerr != nil { log.G(ctx).WithError(rerr).Warn("failed to rollback transaction") } - return nil, errors.Wrap(err, "failed to chown") + return nil, fmt.Errorf("failed to chown: %w", err) } } path = filepath.Join(snapshotDir, s.ID) if err = os.Rename(td, path); err != nil { - return nil, errors.Wrap(err, "failed to rename") + return nil, fmt.Errorf("failed to rename: %w", err) } td = "" @@ -408,7 +407,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k rollback = false if err = t.Commit(); err != nil { - return nil, errors.Wrap(err, "commit failed") + return nil, fmt.Errorf("commit failed: %w", err) } return o.mounts(s, info), nil @@ -417,7 +416,7 @@ func (o *snapshotter) createSnapshot(ctx context.Context, kind snapshots.Kind, k func (o *snapshotter) prepareDirectory(ctx context.Context, snapshotDir string, kind snapshots.Kind) (string, error) { td, err := ioutil.TempDir(snapshotDir, "new-") if err != nil { - return "", errors.Wrap(err, "failed to create temp dir") + return "", fmt.Errorf("failed to create temp dir: %w", err) } if err := os.Mkdir(filepath.Join(td, "fs"), 0755); err != nil { diff --git a/go.mod b/go.mod index 9488285..3294eeb 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,6 @@ require ( github.com/containerd/containerd v1.5.8 github.com/containerd/continuity v0.1.0 github.com/coreos/go-systemd/v22 v22.3.2 - github.com/pkg/errors v0.9.1 github.com/sirupsen/logrus v1.8.1 google.golang.org/grpc v1.33.2 ) From f77071bc108e0f439473822a458a9c31d3b648ce Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 19 Nov 2021 16:11:44 +0900 Subject: [PATCH 4/5] README.md: avoid mentioning Debian 10 kernel patch Debian 10's kernel patch seems to have stability issues See moby/moby issue 42302 Signed-off-by: Akihiro Suda --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 5d6de73..15648af 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,6 @@ Unlike `overlayfs`, `fuse-overlayfs` can be used as a non-root user on almost al You do NOT need this `fuse-overlayfs` plugin on the following environments, because they support the real `overlayfs` for non-root users: - [kernel >= 5.11](https://github.com/torvalds/linux/commit/459c7c565ac36ba09ffbf24231147f408fde4203) - [Ubuntu kernel, since circa 2015](https://kernel.ubuntu.com/git/ubuntu/ubuntu-bionic.git/commit/fs/overlayfs?id=3b7da90f28fe1ed4b79ef2d994c81efbc58f1144) -- [Debian 10 kernel](https://salsa.debian.org/kernel-team/linux/blob/283390e7feb21b47779b48e0c8eb0cc409d2c815/debian/patches/debian/overlayfs-permit-mounts-in-userns.patch) - - Debian 10 needs `sudo modprobe overlay permit_mounts_in_userns=1`. Future release of Debian with kernel >= 5.11 will not need this `modprobe` hack. fuse-overlayfs-snapshotter is a **non-core** sub-project of containerd. From fabc5cea24d507ec5beb72d3c7ffadef50eb6c48 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Fri, 19 Nov 2021 16:24:02 +0900 Subject: [PATCH 5/5] Dockerfile, GHA: update deps (such as Go 1.17) Signed-off-by: Akihiro Suda --- .github/workflows/main.yml | 4 ++-- .github/workflows/release.yml | 2 +- Dockerfile | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 121b527..37aec20 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.17.x - uses: actions/checkout@v2 with: path: src/github.com/containerd/fuse-overlayfs-snapshotter @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - fuse-overlayfs: [v1.0.0, v1.6, main] + fuse-overlayfs: [v1.0.0, v1.7.1, main] env: FUSEOVERLAYFS_COMMIT: "${{ matrix.fuse-overlayfs }}" steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5d5e8c..47485d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/setup-go@v2 with: - go-version: 1.16.x + go-version: 1.17.x - uses: actions/checkout@v2 with: path: go/src/github.com/containerd/fuse-overlayfs-snapshotter diff --git a/Dockerfile b/Dockerfile index 58c5337..4e30117 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,12 +13,12 @@ # limitations under the License. ARG FUSEOVERLAYFS_COMMIT=master -ARG ROOTLESSKIT_COMMIT=v0.14.0 -ARG SHADOW_COMMIT=4.8.1 +ARG ROOTLESSKIT_COMMIT=v0.14.6 +ARG SHADOW_COMMIT=4.9 -ARG GO_VERSION=1.16 -ARG DEBIAN_VERSION=10 -ARG ALPINE_VERSION=3.13 +ARG GO_VERSION=1.17 +ARG DEBIAN_VERSION=11 +ARG ALPINE_VERSION=3.14 FROM golang:${GO_VERSION}-alpine AS containerd-fuse-overlayfs-test COPY . /go/src/github.com/containerd/fuse-overlayfs-snapshotter