Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions .github/workflows/job-test-in-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ jobs:
run:
shell: bash

env:
# https://github.com/containerd/nerdctl/issues/622
# The only case when rootlesskit-version is force-specified is when we downgrade explicitly to v1
WORKAROUND_ISSUE_622: ${{ inputs.rootlesskit-version }}

steps:
- name: "Init: checkout"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -137,16 +142,6 @@ jobs:
sudo mkdir -p /etc/docker
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
sudo systemctl restart docker
# Rootless with old rootlesskit wants to disable buildkit
- if: ${{ inputs.target != 'rootful' && inputs.rootlesskit-version != '' }}
name: "Init: disable buildkit for old rootlesskit"
run: |
# https://github.com/containerd/nerdctl/issues/622
WORKAROUND_ISSUE_622=
if echo "${ROOTLESSKIT_VERSION}" | grep -q v1; then
WORKAROUND_ISSUE_622=1
fi
echo "WORKAROUND_ISSUE_622=$WORKAROUND_ISSUE_622" >> "$GITHUB_ENV"
- name: "Run: integration tests"
run: |
. ./hack/github/action-helpers.sh
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.d/test-integration-rootless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "$(id -u)" = "0" ]]; then
fi

: "${WORKAROUND_ISSUE_622:=}"
if [[ "$WORKAROUND_ISSUE_622" = "1" ]]; then
if [[ "$WORKAROUND_ISSUE_622" != "" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks WORKAROUND_ISSUE_622=0 but I guess we do not need to keep compatibility for this workaround

touch /workaround-issue-622
fi

Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ DOCDIR ?= $(DATADIR)/doc

BINARY ?= "nerdctl"
MAKEFILE_DIR := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
VERSION ?= $(shell git -C $(MAKEFILE_DIR) describe --match 'v[0-9]*' --dirty='.m' --always --tags)
VERSION ?= $(shell git -C $(MAKEFILE_DIR) describe --match 'v[0-9]*' --dirty='.m' --always --tags 2>/dev/null || echo no_git_information)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bikeshedding: an empty string should suffice for no_git_information

VERSION_TRIMMED := $(VERSION:v%=%)
REVISION ?= $(shell git -C $(MAKEFILE_DIR) rev-parse HEAD)$(shell if ! git -C $(MAKEFILE_DIR) diff --no-ext-diff --quiet --exit-code; then echo .m; fi)
REVISION ?= $(shell git -C $(MAKEFILE_DIR) rev-parse HEAD 2>/dev/null || echo no_git_information)$(shell if ! git -C $(MAKEFILE_DIR) diff --no-ext-diff --quiet --exit-code 2>/dev/null; then echo .m; fi)
LINT_COMMIT_RANGE ?= main..HEAD
GO_BUILD_LDFLAGS ?= -s -w
GO_BUILD_FLAGS ?=
Expand Down Expand Up @@ -136,7 +136,8 @@ lint-go-all:
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make lint-go \
&& GOOS=windows make lint-go \
&& GOOS=freebsd make lint-go
&& GOOS=freebsd make lint-go \
&& GOOS=darwin make lint-go
$(call footer, $@)

lint-yaml:
Expand Down Expand Up @@ -179,8 +180,9 @@ lint-licenses-all:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make lint-licenses \
&& GOOS=windows make lint-licenses \
&& GOOS=freebsd make lint-licenses \
&& GOOS=windows make lint-licenses
&& GOOS=darwin make lint-go
$(call footer, $@)

##########################
Expand All @@ -196,8 +198,9 @@ fix-go-all:
$(call title, $@)
@cd $(MAKEFILE_DIR) \
&& GOOS=linux make fix-go \
&& GOOS=windows make fix-go \
&& GOOS=freebsd make fix-go \
&& GOOS=windows make fix-go
&& GOOS=darwin make lint-go
$(call footer, $@)

fix-mod:
Expand Down
6 changes: 5 additions & 1 deletion cmd/nerdctl/container/container_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,11 @@ func TestRunRmTime(t *testing.T) {
base.Cmd("run", "--rm", testutil.CommonImage, "true").AssertOK()
t1 := time.Now()
took := t1.Sub(t0)
const deadline = 3 * time.Second
var deadline = 3 * time.Second
// FIXME: Investigate? it appears that since the move to containerd 2 on Windows, this is taking longer.
if runtime.GOOS == "windows" {
deadline = 10 * time.Second
}
if took > deadline {
t.Fatalf("expected to have completed in %v, took %v", deadline, took)
}
Expand Down
Loading