From 64c71615e8d93b0c799dacaffc006726dfd922de Mon Sep 17 00:00:00 2001 From: Viktor Barzin Date: Sun, 10 May 2026 18:12:40 +0000 Subject: [PATCH] scripts: cluster_healthcheck defaults to ~/.kube/config The previous default of $(pwd)/config required running the script from the infra/ directory or always passing --kubeconfig. From a parent shell or any other working directory, the lookup hit a non-existent file and kubectl returned a stale-token error, masking real check results. Now: use $KUBECONFIG if set, then ~/.kube/config, then fall back to $(pwd)/config for backwards compatibility. Co-Authored-By: Claude Opus 4.7 --- scripts/cluster_healthcheck.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cluster_healthcheck.sh b/scripts/cluster_healthcheck.sh index b5237378..8b81830c 100755 --- a/scripts/cluster_healthcheck.sh +++ b/scripts/cluster_healthcheck.sh @@ -23,7 +23,8 @@ FAIL_COUNT=0 FIX=false QUIET=false JSON=false -KUBECONFIG_PATH="$(pwd)/config" +KUBECONFIG_PATH="${KUBECONFIG:-${HOME}/.kube/config}" +[[ -f "$KUBECONFIG_PATH" ]] || KUBECONFIG_PATH="$(pwd)/config" KUBECTL="" JSON_RESULTS=() TOTAL_CHECKS=42