Skip to content

Commit 1a4afb2

Browse files
authored
ci: fix envtest suite CI failures (#7771)
1 parent 64e5093 commit 1a4afb2

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# renovate: datasource=docker packageName=kindest/node depName=kindest/node@only-patch
2+
- v1.34.0

.github/workflows/_envtest_tests.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,32 @@ permissions:
77
contents: read
88

99
jobs:
10+
matrix_k8s_node_versions:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
matrix: ${{ steps.set-matrix.outputs.matrix }}
14+
latest: ${{ steps.set-latest.outputs.latest }}
15+
steps:
16+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
17+
- id: set-matrix
18+
run: |
19+
(
20+
echo 'matrix<<EOF'
21+
yq eval -o=json '.' .github/supported_k8s_node_versions.yaml
22+
echo 'EOF'
23+
) >> "${GITHUB_OUTPUT}"
24+
- id: set-latest
25+
run: |
26+
(
27+
echo 'latest<<EOF'
28+
yq eval -r -o=json '. | sort | reverse | .[0]' .github/supported_k8s_node_versions.yaml
29+
echo 'EOF'
30+
) >> "${GITHUB_OUTPUT}"
1031
envtest-tests:
1132
timeout-minutes: ${{ fromJSON(vars.GHA_DEFAULT_TIMEOUT || 10) }}
1233
runs-on: ubuntu-latest
34+
needs:
35+
- matrix_k8s_node_versions
1336
steps:
1437
- name: Harden Runner
1538
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
@@ -33,11 +56,18 @@ jobs:
3356
op-token: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
3457

3558
- name: run envtest tests
36-
run: make test.envtest.pretty
3759
env:
3860
GOTESTSUM_JUNITFILE: envtest-tests.xml
3961
TEST_KONG_ENTERPRISE: "true"
4062
KONG_LICENSE_DATA: ${{ steps.license.outputs.license }}
63+
run: |
64+
VERSION="${{ needs.matrix_k8s_node_versions.outputs.latest }}"
65+
# Remove leading 'v'
66+
VERSION="${VERSION#v}"
67+
# Remove patch number as envtest releases are not provided for every patch version
68+
VERSION="${VERSION%.*}"
69+
echo "Cluster version: $VERSION"
70+
make test.envtest.pretty CLUSTER_VERSION=${VERSION}
4171
4272
- name: collect test coverage
4373
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,10 @@ ENVTEST_TIMEOUT ?= 8m
439439
.PHONY: _test.envtest
440440
.ONESHELL: _test.envtest
441441
_test.envtest: gotestsum setup-envtest use-setup-envtest
442-
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use -p path)" \
442+
# Disable testcontainer's reaper (Ryuk). It's needed because Ryuk requires
443+
# privileged mode to run, which is not desired and could cause issues in CI.
444+
TESTCONTAINERS_RYUK_DISABLED="true" \
445+
KUBEBUILDER_ASSETS="$(shell $(SETUP_ENVTEST) use $(CLUSTER_VERSION) -p path)" \
443446
GOTESTSUM_FORMAT=$(GOTESTSUM_FORMAT) \
444447
$(GOTESTSUM) \
445448
--hide-summary output \

0 commit comments

Comments
 (0)