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 <github@gone.nl>
(cherry picked from commit 7b0ef10)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • 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.