Skip to content

Commit 827130a

Browse files
authored
Add cluster auth preflight check to run-benchmark.sh (kroxylicious#3751)
Fail fast with a clear error message when kubectl is not authenticated, instead of failing deep into the benchmark run with cryptic API errors. Assisted-by: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Sam Barker <sam@quadrocket.co.uk>
1 parent a71b175 commit 827130a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

kroxylicious-openmessaging-benchmarks/scripts/run-benchmark.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ if [[ -n "${CLUSTER_OVERRIDES}" && ! -f "${CLUSTER_OVERRIDES}" ]]; then
169169
exit 1
170170
fi
171171

172+
# Preflight: verify we can talk to the cluster
173+
if ! kubectl auth can-i get pods -n "${NAMESPACE}" &>/dev/null; then
174+
echo "Error: not authenticated to cluster — check kubectl/oc login" >&2
175+
exit 1
176+
fi
177+
172178
METRICS_PID=""
173179
LOGS_PID=""
174180

0 commit comments

Comments
 (0)