diff --git a/hack/e2e-install-cozystack.bats b/hack/e2e-install-cozystack.bats index d57002f0..cf66b73f 100644 --- a/hack/e2e-install-cozystack.bats +++ b/hack/e2e-install-cozystack.bats @@ -222,8 +222,12 @@ EOF # server-side name check runs and the error we grep for is the tenant # contract error, not a kubectl schema rejection. (--validate=false is the # deprecated alias.) - local output - output=$(kubectl apply --validate=ignore -f - <&1 || true + local output rc + # Run the apply in its own subshell so we can capture BOTH stdout+stderr + # AND the exit code explicitly, without `|| true` swallowing a real failure + # mode (e.g. network error, auth failure) that should also fail the test. + output=$( + kubectl apply --validate=ignore -f - 2>&1 <