Skip to content

Commit ec23297

Browse files
scotwellsclaude
andcommitted
fix: respect KUBECONFIG env var for external repo kubeconfig path
When consumers use the kind-bootstrap GitHub Action, the action sets the KUBECONFIG env var to the kubeconfig file it creates. The Taskfile previously ignored this env var and always fell back to the hardcoded .test-infra/kubeconfig path, causing task commands to fail. Now the external repo branch checks the KUBECONFIG env var first and only falls back to .test-infra/kubeconfig if the env var is unset or the file it points to does not exist. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9c7ef8a commit ec23297

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Taskfile.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ vars:
1111
sh: |
1212
if [ -f "cluster/kind-config.yaml" ] && [ -f "components/flux/kustomization.yaml" ]; then
1313
echo "./kubeconfig" # In test-infra repo
14+
elif [ -n "$KUBECONFIG" ] && [ -f "$KUBECONFIG" ]; then
15+
echo "$KUBECONFIG" # External repo: use KUBECONFIG env var if set and file exists
1416
else
15-
echo ".test-infra/kubeconfig" # External repo
17+
echo ".test-infra/kubeconfig" # External repo: default fallback
1618
fi
1719
# Detect if we're running in the test-infra repo or externally
1820
REPO_DIR:

0 commit comments

Comments
 (0)