Skip to content

Commit

Permalink
migrate to github.com/moby/sys/userns
Browse files Browse the repository at this point in the history
Commit 2ce811e 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]>
(cherry picked from commit 7b0ef10)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Aug 8, 2024
1 parent 95db705 commit 80a59c2
Show file tree
Hide file tree
Showing 28 changed files with 234 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ linters-settings:
- pkg: "github.com/containerd/containerd/log"
desc: The logs package has moved to a separate module, https://github.com/containerd/log
- pkg: "github.com/containerd/containerd/pkg/userns"
desc: Use github.com/moby/sys/user/userns instead.
desc: Use github.com/moby/sys/userns instead.
- pkg: "github.com/opencontainers/runc/libcontainer/userns"
desc: Use github.com/moby/sys/user/userns instead.
desc: Use github.com/moby/sys/userns instead.
revive:
rules:
# FIXME make sure all packages have a description. Currently, there's many packages without.
Expand Down
2 changes: 1 addition & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ import (
resolverconfig "github.com/moby/buildkit/util/resolver/config"
"github.com/moby/buildkit/util/tracing"
"github.com/moby/locker"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/pkg/errors"
"go.etcd.io/bbolt"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
Expand Down
2 changes: 1 addition & 1 deletion daemon/daemon_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"github.com/docker/docker/runconfig"
volumemounts "github.com/docker/docker/volume/mounts"
"github.com/moby/sys/mount"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/opencontainers/selinux/go-selinux"
"github.com/opencontainers/selinux/go-selinux/label"
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/btrfs/btrfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import (
"github.com/docker/docker/pkg/parsers"
units "github.com/docker/go-units"
"github.com/moby/sys/mount"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/copy/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

"github.com/docker/docker/pkg/pools"
"github.com/docker/docker/pkg/system"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"golang.org/x/sys/unix"
)

Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/fuse-overlayfs/fuseoverlayfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/docker/docker/pkg/parsers/kernel"
"github.com/moby/locker"
"github.com/moby/sys/mount"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/opencontainers/selinux/go-selinux/label"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/overlay2/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/containerd/containerd/mount"
"github.com/docker/docker/daemon/graphdriver/overlayutils"
"github.com/docker/docker/pkg/system"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/overlay2/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
units "github.com/docker/go-units"
"github.com/moby/locker"
"github.com/moby/sys/mount"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/opencontainers/selinux/go-selinux/label"
"golang.org/x/sys/unix"
)
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/overlayutils/overlayutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/containerd/log"
"github.com/docker/docker/daemon/graphdriver"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
Expand Down
2 changes: 1 addition & 1 deletion daemon/graphdriver/overlayutils/userxattr.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/containerd/containerd/mount"
"github.com/containerd/log"
"github.com/docker/docker/pkg/parsers/kernel"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
)

// NeedsUserXAttr returns whether overlayfs should be mounted with the "userxattr" mount option.
Expand Down
2 changes: 1 addition & 1 deletion daemon/oci_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/moby/sys/mount"
"github.com/moby/sys/mountinfo"
"github.com/moby/sys/user"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/opencontainers/runc/libcontainer/cgroups"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion pkg/archive/archive_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strings"

"github.com/docker/docker/pkg/system"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/archive/archive_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/docker/docker/pkg/system"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"golang.org/x/sys/unix"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
Expand Down
2 changes: 1 addition & 1 deletion pkg/archive/archive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (

"github.com/docker/docker/pkg/idtools"
"github.com/docker/docker/pkg/ioutils"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
"gotest.tools/v3/skip"
Expand Down
2 changes: 1 addition & 1 deletion pkg/archive/archive_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"testing"

"github.com/docker/docker/pkg/system"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"golang.org/x/sys/unix"
"gotest.tools/v3/assert"
is "gotest.tools/v3/assert/cmp"
Expand Down
2 changes: 1 addition & 1 deletion pkg/chrootarchive/diff_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path/filepath"

"github.com/docker/docker/pkg/archive"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
)

// applyLayerHandler parses a diff in the standard layer format from `layer`, and
Expand Down
2 changes: 1 addition & 1 deletion pkg/plugins/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"

"github.com/containerd/log"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/sysinfo/cgroup2_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/containerd/cgroups/v3"
cgroupsV2 "github.com/containerd/cgroups/v3/cgroup2"
"github.com/containerd/log"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
)

func newV2(options ...Opt) *SysInfo {
Expand Down
2 changes: 1 addition & 1 deletion plugin/v2/plugin_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/docker/docker/internal/rootless/mountopts"
"github.com/docker/docker/internal/sliceutil"
"github.com/docker/docker/oci"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion quota/projectquota.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import (
"unsafe"

"github.com/containerd/log"
"github.com/moby/sys/user/userns"
"github.com/moby/sys/userns"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
)
Expand Down
3 changes: 2 additions & 1 deletion vendor.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ require (
github.com/moby/sys/sequential v0.5.0
github.com/moby/sys/signal v0.7.0
github.com/moby/sys/symlink v0.2.0
github.com/moby/sys/user v0.2.0
github.com/moby/sys/user v0.3.0
github.com/moby/sys/userns v0.1.0
github.com/moby/term v0.5.0
github.com/morikuni/aec v1.0.0
github.com/opencontainers/go-digest v1.0.0
Expand Down
6 changes: 4 additions & 2 deletions vendor.sum
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,10 @@ github.com/moby/sys/signal v0.7.0 h1:25RW3d5TnQEoKvRbEKUGay6DCQ46IxAVTT9CUMgmsSI
github.com/moby/sys/signal v0.7.0/go.mod h1:GQ6ObYZfqacOwTtlXvcmh9A26dVRul/hbOZn88Kg8Tg=
github.com/moby/sys/symlink v0.2.0 h1:tk1rOM+Ljp0nFmfOIBtlV3rTDlWOwFRhjEeAhZB0nZc=
github.com/moby/sys/symlink v0.2.0/go.mod h1:7uZVF2dqJjG/NsClqul95CqKOBRQyYSNnJ6BMgR/gFs=
github.com/moby/sys/user v0.2.0 h1:OnpapJsRp25vkhw8TFG6OLJODNh/3rEwRWtJ3kakwRM=
github.com/moby/sys/user v0.2.0/go.mod h1:RYstrcWOJpVh+6qzUqp2bU3eaRpdiQeKGlKitaH0PM8=
github.com/moby/sys/user v0.3.0 h1:9ni5DlcW5an3SvRSx4MouotOygvzaXbaSrc/wGDFWPo=
github.com/moby/sys/user v0.3.0/go.mod h1:bG+tYYYJgaMtRKgEmuueC0hJEAZWwtIbZTB+85uoHjs=
github.com/moby/sys/userns v0.1.0 h1:tVLXkFOxVu9A64/yh59slHVv9ahO9UIev4JZusOLG/g=
github.com/moby/sys/userns v0.1.0/go.mod h1:IHUYgu/kao6N8YZlp9Cf444ySSvCmDlmzUcYfDHOl28=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand Down
Loading

0 comments on commit 80a59c2

Please sign in to comment.