Skip to content

Commit b4a1893

Browse files
committed
migrate to github.com/moby/sys/userns
Commit 4b85f11 migrated the use of the userns package to the github.com/moby/sys/user module. After further discussion with maintainers, it was decided to move the userns package to a separate module, as it has no direct relation with "user" operations (other than having "user" in its name). This patch migrates our code to use the new module. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a708e34 commit b4a1893

File tree

19 files changed

+225
-18
lines changed

19 files changed

+225
-18
lines changed

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ linters-settings:
5353
- pkg: "github.com/containerd/containerd/log"
5454
desc: The containerd log package was migrated to a separate module. Use github.com/containerd/log instead.
5555
- pkg: "github.com/containerd/containerd/pkg/userns"
56-
desc: Use github.com/moby/sys/user/userns instead.
56+
desc: Use github.com/moby/sys/userns instead.
5757
- pkg: "github.com/containerd/containerd/platforms"
5858
desc: The containerd platforms package was migrated to a separate module. Use github.com/containerd/platforms instead.
5959
- pkg: "github.com/containerd/nydus-snapshotter/pkg/errdefs"
6060
desc: You probably meant to use github.com/containerd/errdefs
6161
- pkg: "github.com/opencontainers/runc/libcontainer/userns"
62-
desc: Use github.com/moby/sys/user/userns instead.
62+
desc: Use github.com/moby/sys/userns instead.
6363
- pkg: "io/ioutil"
6464
desc: The io/ioutil package has been deprecated.
6565
forbidigo:

cache/refs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
rootlessmountopts "github.com/moby/buildkit/util/rootless/mountopts"
3434
"github.com/moby/buildkit/util/winlayers"
3535
"github.com/moby/sys/mountinfo"
36-
"github.com/moby/sys/user/userns"
36+
"github.com/moby/sys/userns"
3737
digest "github.com/opencontainers/go-digest"
3838
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
3939
"github.com/pkg/errors"

cmd/buildkitd/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import (
5858
"github.com/moby/buildkit/util/tracing/transform"
5959
"github.com/moby/buildkit/version"
6060
"github.com/moby/buildkit/worker"
61-
"github.com/moby/sys/user/userns"
61+
"github.com/moby/sys/userns"
6262
ocispecs "github.com/opencontainers/image-spec/specs-go/v1"
6363
"github.com/pkg/errors"
6464
"github.com/sirupsen/logrus"

cmd/buildkitd/main_containerd_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/moby/buildkit/worker"
2222
"github.com/moby/buildkit/worker/base"
2323
"github.com/moby/buildkit/worker/containerd"
24-
"github.com/moby/sys/user/userns"
24+
"github.com/moby/sys/userns"
2525
"github.com/pelletier/go-toml"
2626
"github.com/pkg/errors"
2727
"github.com/urfave/cli"

cmd/buildkitd/main_oci_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"github.com/moby/buildkit/worker"
4040
"github.com/moby/buildkit/worker/base"
4141
"github.com/moby/buildkit/worker/runc"
42-
"github.com/moby/sys/user/userns"
42+
"github.com/moby/sys/userns"
4343
"github.com/pelletier/go-toml"
4444
"github.com/pkg/errors"
4545
"github.com/sirupsen/logrus"

executor/oci/spec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/moby/buildkit/util/network"
2121
rootlessmountopts "github.com/moby/buildkit/util/rootless/mountopts"
2222
traceexec "github.com/moby/buildkit/util/tracing/exec"
23-
"github.com/moby/sys/user/userns"
23+
"github.com/moby/sys/userns"
2424
specs "github.com/opencontainers/runtime-spec/specs-go"
2525
"github.com/opencontainers/selinux/go-selinux"
2626
"github.com/pkg/errors"

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ require (
5353
github.com/moby/patternmatcher v0.6.0
5454
github.com/moby/sys/mountinfo v0.7.1
5555
github.com/moby/sys/signal v0.7.0
56-
github.com/moby/sys/user v0.2.0
56+
github.com/moby/sys/user v0.3.0
57+
github.com/moby/sys/userns v0.1.0
5758
github.com/morikuni/aec v1.0.0
5859
github.com/opencontainers/go-digest v1.0.0
5960
github.com/opencontainers/image-spec v1.1.0

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,10 @@ github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5
296296
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
297297
github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI=
298298
github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg=
299-
github.com/moby/sys/user v0.2.0 h1:OnpapJsRp25vkhw8TFG6OLJODNh/3rEwRWtJ3kakwRM=
300-
github.com/moby/sys/user v0.2.0/go.mod h1:RYstrcWOJpVh+6qzUqp2bU3eaRpdiQeKGlKitaH0PM8=
299+
github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo=
300+
github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
301+
github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
302+
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
301303
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
302304
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
303305
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=

snapshot/localmounter_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/containerd/containerd/mount"
99
rootlessmountopts "github.com/moby/buildkit/util/rootless/mountopts"
10-
"github.com/moby/sys/user/userns"
10+
"github.com/moby/sys/userns"
1111
"github.com/pkg/errors"
1212
)
1313

snapshot/merge.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/moby/buildkit/identity"
1010
"github.com/moby/buildkit/util/bklog"
1111
"github.com/moby/buildkit/util/leaseutil"
12-
"github.com/moby/sys/user/userns"
12+
"github.com/moby/sys/userns"
1313
"github.com/pkg/errors"
1414
)
1515

0 commit comments

Comments
 (0)