diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a73adf..0ef96fb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,11 @@ jobs: go-version: ${{ matrix.go-version }} - name: Checkout code uses: actions/checkout@v4 + - run: | + if [ "${{ matrix.go-version }}" = "1.18.x" ]; then + # Skip userns on go1.18.x + echo 'PACKAGES="mountinfo mount sequential signal symlink user"' >> $GITHUB_ENV + fi - name: go mod tidy run: | make tidy diff --git a/Makefile b/Makefile index c83bf16..50ce9e5 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -16,18 +16,14 @@ clean: test: test-local set -eu; \ for p in $(PACKAGES); do \ - if $p = user && go version | grep -qv go1.18; then \ - (cd $$p; go test $(RUN_VIA_SUDO) -v .); \ - fi \ + (cd $$p; go test $(RUN_VIA_SUDO) -v .); \ done .PHONY: tidy tidy: set -eu; \ for p in $(PACKAGES); do \ - if $p = user && go version | grep -qv go1.18; then \ - (cd $$p; go mod tidy); \ - fi \ + (cd $$p; go mod tidy); \ done # Test the mount module against the local mountinfo source code instead of the @@ -46,11 +42,9 @@ 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 \ - (cd $$p; \ - go mod download; \ - ../$(BINDIR)/golangci-lint run); \ - fi \ + (cd $$p; \ + go mod download; \ + ../$(BINDIR)/golangci-lint run); \ done $(BINDIR)/golangci-lint: $(BINDIR) diff --git a/user/go.mod b/user/go.mod index d4ad72f..bf7886e 100644 --- a/user/go.mod +++ b/user/go.mod @@ -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. diff --git a/userns/go.mod b/userns/go.mod new file mode 100644 index 0000000..1b656e4 --- /dev/null +++ b/userns/go.mod @@ -0,0 +1,3 @@ +module github.com/moby/sys/userns + +go 1.21 diff --git a/user/userns/userns.go b/userns/userns.go similarity index 100% rename from user/userns/userns.go rename to userns/userns.go diff --git a/user/userns/userns_linux.go b/userns/userns_linux.go similarity index 100% rename from user/userns/userns_linux.go rename to userns/userns_linux.go diff --git a/user/userns/userns_linux_fuzzer.go b/userns/userns_linux_fuzzer.go similarity index 100% rename from user/userns/userns_linux_fuzzer.go rename to userns/userns_linux_fuzzer.go diff --git a/user/userns/userns_linux_test.go b/userns/userns_linux_test.go similarity index 100% rename from user/userns/userns_linux_test.go rename to userns/userns_linux_test.go diff --git a/user/userns/userns_unsupported.go b/userns/userns_unsupported.go similarity index 100% rename from user/userns/userns_unsupported.go rename to userns/userns_unsupported.go