-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
user: move userns package to separate module, and retract v0.2.0 #145
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the same list as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, no good solution for that, honestly. Unless we probably introduce more complexity. Overall, the risk is low;
I'd consider only the last one slightly problematic, but perhaps a calculated risk, given that adding more modules should be a rare event 🙈 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. erm: middle bullet is obviously wrong; so only 1st and last apply 🤦♂️ |
||
- name: go mod tidy | ||
run: | | ||
make tidy | ||
|
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And added a comment here as a reminder to check the one in the GitHub actions workflow when updating. |
||
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) | ||
|
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. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/moby/sys/userns | ||
|
||
go 1.21 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment here to relate it to the variable in the Makefile