Skip to content

Commit ebd3e30

Browse files
committed
fix(e2e): rename the tool-bin var to avoid a foundation var collision
A remote Taskfile include's root var clobbers a same-named var in the consumer Taskfile. Compute and the test-infra foundation both defined LOCALBIN, so compute's {{.ROOT_DIR}}/bin was overridden by the foundation's REPO_DIR-based definition; REPO_DIR is undefined in the compute scope, so the value rendered as a literal "%!s(<nil>)/bin" — chainsaw would have installed to a bogus directory and e2e:test could not have found it. Rename the var to E2E_BIN, which does not collide. KARMADA_API_NODEPORT also shares a name with a foundation var, but it is passed through the include by design and resolves to the same value (override included), so it is unaffected.
1 parent e694a75 commit ebd3e30

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Taskfile.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@ vars:
1212
# Chainsaw version for e2e testing (kyverno/chainsaw)
1313
CHAINSAW_VERSION: v0.2.15
1414

15-
# Local tool directory (mirrors Makefile convention)
16-
LOCALBIN: '{{.ROOT_DIR}}/bin'
15+
# Local directory for e2e tooling. Deliberately NOT named LOCALBIN: the
16+
# test-infra foundation defines its own LOCALBIN, and a remote include's root
17+
# var clobbers a same-named var in this Taskfile — compute's value would be
18+
# overwritten by the foundation's REPO_DIR-based path, which is undefined in
19+
# this scope and renders as a nil path.
20+
E2E_BIN: '{{.ROOT_DIR}}/bin'
1721
CHAINSAW: '{{.ROOT_DIR}}/bin/chainsaw'
1822

1923
# Kind cluster names. These are also the Karmada member/hub cluster names the
@@ -169,14 +173,14 @@ tasks:
169173
e2e:tools:chainsaw:
170174
desc: "Download chainsaw {{.CHAINSAW_VERSION}}"
171175
cmds:
172-
- mkdir -p {{.LOCALBIN}}
176+
- mkdir -p {{.E2E_BIN}}
173177
- |
174178
if [ ! -f "{{.CHAINSAW}}" ]; then
175179
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
176180
ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')
177181
URL="https://github.com/kyverno/chainsaw/releases/download/{{.CHAINSAW_VERSION}}/chainsaw_${OS}_${ARCH}.tar.gz"
178182
echo "Downloading chainsaw {{.CHAINSAW_VERSION}} (${OS}/${ARCH}) from ${URL}..."
179-
curl -sSfL "${URL}" | tar -xz -C {{.LOCALBIN}} chainsaw
183+
curl -sSfL "${URL}" | tar -xz -C {{.E2E_BIN}} chainsaw
180184
chmod +x {{.CHAINSAW}}
181185
echo "chainsaw installed → {{.CHAINSAW}}"
182186
else

0 commit comments

Comments
 (0)