fix: remove namespace create/delete from E2E scripts

The CI runner SA only has namespace-scoped RBAC in headlamp-e2e — it
cannot create or delete namespaces at the cluster level. Deploy now
verifies the namespace exists (with a clear error if not), and teardown
cleans up resources without deleting the namespace itself.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-03-20 01:13:02 +00:00
parent 902f206e32
commit 0a52a8effa
2 changed files with 17 additions and 5 deletions
+8 -2
View File
@@ -20,8 +20,14 @@ echo " Release: $E2E_RELEASE"
echo "Uninstalling Helm release..."
helm uninstall "$E2E_RELEASE" -n "$E2E_NAMESPACE" 2>/dev/null || echo "Release not found (already removed?)"
echo "Deleting namespace..."
kubectl delete namespace "$E2E_NAMESPACE" --ignore-not-found --wait=false
echo "Cleaning up ConfigMap..."
kubectl delete configmap headlamp-polaris-plugin -n "$E2E_NAMESPACE" --ignore-not-found
echo "Cleaning up service account..."
kubectl delete serviceaccount headlamp-e2e-test -n "$E2E_NAMESPACE" --ignore-not-found
# Note: namespace is NOT deleted — it is managed by a cluster admin.
# The runner SA only has namespace-scoped permissions (see deployment/e2e-ci-runner-rbac.yaml).
# Clean up local env file
rm -f "$REPO_ROOT/.env.e2e"