Skip to content

Commit

Permalink
user: move userns package to separate module, and retract v0.2.0
Browse files Browse the repository at this point in the history
commit 86870e7 integrated the userns package
into the github.com/moby/sys/user module, which was included in the v0.2.0
version of the module.

Upon further discussion with maintainers, this may not have been a good
choice; the userns package is related to user-namespaces (uid/gid-mapping),
and while there are some tangential relations with "user", we shouldn't
conflate these concepts by putting both into the same module.

Some downstream projects (containerd, moby, containerd/cgroups) already
accepted patches to switch to the package that's part of the moby/sys/user
module, but none of those patches made it into a release.

This patch:

- moves the userns package to a separate module
- retracts the moby/sys/user v0.2.0 release
- downgrades the minimum go version update for the moby/sys/user module
  to go1.17. Note that CI is no longer testing go1.17, but go1.18 as minimum.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Aug 6, 2024
1 parent 86870e7 commit 16e891a
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 6 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PACKAGES ?= mountinfo mount sequential signal symlink user
PACKAGES ?= mountinfo mount sequential signal symlink user userns
BINDIR ?= _build/bin
CROSS ?= linux/arm linux/arm64 linux/ppc64le linux/s390x \
freebsd/amd64 openbsd/amd64 darwin/amd64 darwin/arm64 windows/amd64
Expand All @@ -16,7 +16,7 @@ clean:
test: test-local
set -eu; \
for p in $(PACKAGES); do \
if $p = user && go version | grep -qv go1.18; then \
if [ "$p" != userns ] || [ "$p" = userns ] && go version | grep -qv go1.18; then \
(cd $$p; go test $(RUN_VIA_SUDO) -v .); \
fi \
done
Expand All @@ -25,7 +25,7 @@ test: test-local
tidy:
set -eu; \
for p in $(PACKAGES); do \
if $p = user && go version | grep -qv go1.18; then \
if [ "$p" != userns ] || [ "$p" = userns ] && go version | grep -qv go1.18; then \
(cd $$p; go mod tidy); \
fi \
done
Expand All @@ -46,7 +46,7 @@ lint: $(BINDIR)/golangci-lint
$(BINDIR)/golangci-lint version
set -eu; \
for p in $(PACKAGES); do \
if $p = user && go version | grep -qv go1.18; then \
if [ "$p" != userns ] || [ "$p" = userns ] && go version | grep -qv go1.18; then \
(cd $$p; \
go mod download; \
../$(BINDIR)/golangci-lint run); \
Expand All @@ -66,6 +66,8 @@ cross:
export GOOS=$${osarch%/*} GOARCH=$${osarch#*/}; \
echo "# building for $$GOOS/$$GOARCH"; \
for p in $(PACKAGES); do \
(cd $$p; go build .); \
if [ "$p" != userns ] || [ "$p" = userns ] && go version | grep -qv go1.18; then \
(cd $$p; go build .); \
fi \
done; \
done
4 changes: 3 additions & 1 deletion user/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/moby/sys/user

go 1.21
go 1.17

require golang.org/x/sys v0.1.0

retract v0.2.0 // Package github.com/moby/sys/user/userns was included in this module, but should've been a separate module; see https://github.com/moby/sys/pull/140#issuecomment-2250644304.
3 changes: 3 additions & 0 deletions userns/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/moby/sys/userns

go 1.21
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 16e891a

Please sign in to comment.