Skip to content

Commit

Permalink
Merge pull request #145 from thaJeztah/separate_userns
Browse files Browse the repository at this point in the history
user: move userns package to separate module, and retract v0.2.0
  • Loading branch information
tianon authored Aug 7, 2024
2 parents 86870e7 + 370a9ed commit 5447519
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
- if: ${{ matrix.go-version == '1.18.x' }}
run: |
# This corresponds with the list in Makefile:1, but omits the "userns"
# module, which requires go1.21 as minimum.
echo 'PACKAGES="mountinfo mount sequential signal symlink user"' >> $GITHUB_ENV
- name: go mod tidy
run: |
make tidy
Expand Down
18 changes: 6 additions & 12 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 # IMPORTANT: when updating this list, also update the conditional one in .github/workflows/test.yml
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,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
Expand All @@ -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)
Expand Down
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 5447519

Please sign in to comment.