Skip to content

Commit 5447519

Browse files
authored
Merge pull request #145 from thaJeztah/separate_userns
user: move userns package to separate module, and retract v0.2.0
2 parents 86870e7 + 370a9ed commit 5447519

File tree

9 files changed

+17
-13
lines changed

9 files changed

+17
-13
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ jobs:
1414
go-version: ${{ matrix.go-version }}
1515
- name: Checkout code
1616
uses: actions/checkout@v4
17+
- if: ${{ matrix.go-version == '1.18.x' }}
18+
run: |
19+
# This corresponds with the list in Makefile:1, but omits the "userns"
20+
# module, which requires go1.21 as minimum.
21+
echo 'PACKAGES="mountinfo mount sequential signal symlink user"' >> $GITHUB_ENV
1722
- name: go mod tidy
1823
run: |
1924
make tidy

Makefile

Lines changed: 6 additions & 12 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 # IMPORTANT: when updating this list, also update the conditional one in .github/workflows/test.yml
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,18 +16,14 @@ 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 \
20-
(cd $$p; go test $(RUN_VIA_SUDO) -v .); \
21-
fi \
19+
(cd $$p; go test $(RUN_VIA_SUDO) -v .); \
2220
done
2321

2422
.PHONY: tidy
2523
tidy:
2624
set -eu; \
2725
for p in $(PACKAGES); do \
28-
if $p = user && go version | grep -qv go1.18; then \
29-
(cd $$p; go mod tidy); \
30-
fi \
26+
(cd $$p; go mod tidy); \
3127
done
3228

3329
# Test the mount module against the local mountinfo source code instead of the
@@ -46,11 +42,9 @@ lint: $(BINDIR)/golangci-lint
4642
$(BINDIR)/golangci-lint version
4743
set -eu; \
4844
for p in $(PACKAGES); do \
49-
if $p = user && go version | grep -qv go1.18; then \
50-
(cd $$p; \
51-
go mod download; \
52-
../$(BINDIR)/golangci-lint run); \
53-
fi \
45+
(cd $$p; \
46+
go mod download; \
47+
../$(BINDIR)/golangci-lint run); \
5448
done
5549

5650
$(BINDIR)/golangci-lint: $(BINDIR)

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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)