Skip to content

Commit

Permalink
migrate to github.com/moby/sys/user
Browse files Browse the repository at this point in the history
The github.com/opencontainers/runc/libcontainer/user package was moved
to a separate module. While there's still uses of the old module in
our code-base, runc itself is migrating to the new module, and deprecated
the old package (for runc 1.2).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Oct 24, 2023
1 parent b4a08b3 commit df3a321
Show file tree
Hide file tree
Showing 10 changed files with 1,018 additions and 5 deletions.
6 changes: 3 additions & 3 deletions builder/dockerfile/internals_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/docker/docker/pkg/idtools"
"github.com/moby/sys/symlink"
lcUser "github.com/opencontainers/runc/libcontainer/user"
"github.com/moby/sys/user"
"github.com/pkg/errors"
)

Expand Down Expand Up @@ -57,7 +57,7 @@ func lookupUser(userStr, filepath string) (int, error) {
if err == nil {
return uid, nil
}
users, err := lcUser.ParsePasswdFileFilter(filepath, func(u lcUser.User) bool {
users, err := user.ParsePasswdFileFilter(filepath, func(u user.User) bool {
return u.Name == userStr
})
if err != nil {
Expand All @@ -76,7 +76,7 @@ func lookupGroup(groupStr, filepath string) (int, error) {
if err == nil {
return gid, nil
}
groups, err := lcUser.ParseGroupFileFilter(filepath, func(g lcUser.Group) bool {
groups, err := user.ParseGroupFileFilter(filepath, func(g user.Group) bool {
return g.Name == groupStr
})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion daemon/oci_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
volumemounts "github.com/docker/docker/volume/mounts"
"github.com/moby/sys/mount"
"github.com/moby/sys/mountinfo"
"github.com/moby/sys/user"
"github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/user"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
Expand Down
2 changes: 1 addition & 1 deletion pkg/idtools/idtools_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"strconv"
"syscall"

"github.com/opencontainers/runc/libcontainer/user"
"github.com/moby/sys/user"
)

func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error {
Expand Down
1 change: 1 addition & 0 deletions vendor.mod
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ 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.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
2 changes: 2 additions & 0 deletions vendor.sum
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,8 @@ 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.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg=
github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU=
github.com/moby/term v0.0.0-20200915141129-7f0af18e79f2/go.mod h1:TjQg8pa4iejrUrjiz0MCtMV38jdMNW4doKSiBrEvCQQ=
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=
Expand Down
202 changes: 202 additions & 0 deletions vendor/github.com/moby/sys/user/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df3a321

Please sign in to comment.