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
f5b1fb179a
commit
a2377a38df
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue