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 <noreply@anthropic.com>
This commit is contained in:
parent
a245e6e569
commit
64c71615e8
1 changed files with 2 additions and 1 deletions
|
|
@ -23,7 +23,8 @@ FAIL_COUNT=0
|
||||||
FIX=false
|
FIX=false
|
||||||
QUIET=false
|
QUIET=false
|
||||||
JSON=false
|
JSON=false
|
||||||
KUBECONFIG_PATH="$(pwd)/config"
|
KUBECONFIG_PATH="${KUBECONFIG:-${HOME}/.kube/config}"
|
||||||
|
[[ -f "$KUBECONFIG_PATH" ]] || KUBECONFIG_PATH="$(pwd)/config"
|
||||||
KUBECTL=""
|
KUBECTL=""
|
||||||
JSON_RESULTS=()
|
JSON_RESULTS=()
|
||||||
TOTAL_CHECKS=42
|
TOTAL_CHECKS=42
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue