fix: teardown-e2e-headlamp.sh gracefully skips missing namespace
When the headlamp-e2e namespace does not exist, teardown now exits early with a clear message instead of failing with a misleading RBAC error. Addresses PRI-443. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -13,6 +13,12 @@ REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
E2E_NAMESPACE="${E2E_NAMESPACE:-headlamp-e2e}"
|
||||
E2E_RELEASE="${E2E_RELEASE:-headlamp-e2e}"
|
||||
|
||||
# Exit early if the namespace does not exist — nothing to tear down.
|
||||
if ! kubectl get namespace "$E2E_NAMESPACE" >/dev/null 2>&1; then
|
||||
echo "Namespace $E2E_NAMESPACE does not exist, nothing to tear down."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "=== E2E Headlamp Teardown ==="
|
||||
echo " Namespace: $E2E_NAMESPACE"
|
||||
echo " Release: $E2E_RELEASE"
|
||||
|
||||
Reference in New Issue
Block a user