Skip to content

Commit 6867143

Browse files
committed
user: move userns package to separate module, and retract v0.2.0
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 <github@gone.nl>
1 parent 86870e7 commit 6867143

8 files changed

Lines changed: 13 additions & 6 deletions

File tree

Makefile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PACKAGES ?= mountinfo mount sequential signal symlink user
1+
PACKAGES ?= mountinfo mount sequential signal symlink user userns
22
BINDIR ?= _build/bin
33
CROSS ?= linux/arm linux/arm64 linux/ppc64le linux/s390x \
44
freebsd/amd64 openbsd/amd64 darwin/amd64 darwin/arm64 windows/amd64
@@ -16,7 +16,7 @@ clean:
1616
test: test-local
1717
set -eu; \
1818
for p in $(PACKAGES); do \
19-
if $p = user && go version | grep -qv go1.18; then \
19+
if [ "$p" = userns ] && go version | grep -qv go1.18; then \
2020
(cd $$p; go test $(RUN_VIA_SUDO) -v .); \
2121
fi \
2222
done
@@ -25,7 +25,7 @@ test: test-local
2525
tidy:
2626
set -eu; \
2727
for p in $(PACKAGES); do \
28-
if $p = user && go version | grep -qv go1.18; then \
28+
if [ "$p" = userns ] && go version | grep -qv go1.18; then \
2929
(cd $$p; go mod tidy); \
3030
fi \
3131
done
@@ -46,7 +46,7 @@ lint: $(BINDIR)/golangci-lint
4646
$(BINDIR)/golangci-lint version
4747
set -eu; \
4848
for p in $(PACKAGES); do \
49-
if $p = user && go version | grep -qv go1.18; then \
49+
if [ "$p" = userns ] && go version | grep -qv go1.18; then \
5050
(cd $$p; \
5151
go mod download; \
5252
../$(BINDIR)/golangci-lint run); \
@@ -66,6 +66,8 @@ cross:
6666
export GOOS=$${osarch%/*} GOARCH=$${osarch#*/}; \
6767
echo "# building for $$GOOS/$$GOARCH"; \
6868
for p in $(PACKAGES); do \
69-
(cd $$p; go build .); \
69+
if [ "$p" = userns ] && go version | grep -qv go1.18; then \
70+
(cd $$p; go build .); \
71+
fi \
7072
done; \
7173
done

user/go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module github.com/moby/sys/user
22

3-
go 1.21
3+
go 1.17
44

55
require golang.org/x/sys v0.1.0
6+
7+
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.

userns/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/moby/sys/userns
2+
3+
go 1.21
File renamed without changes.

0 commit comments

Comments
 (0)