f1a87fc079
PRI-750: update plugin repos to reference shared infra RBAC (PRI-695 follow-up) - deployment/e2e-ci-runner-rbac.yaml: replaced duplicate manifest with reference comment pointing to privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml - scripts/deploy-e2e-headlamp.sh: updated RBAC preflight comment and error message to reference infra path - scripts/teardown-e2e-headlamp.sh: added RBAC reference comment Infra RBAC is the source of truth managed by Flux GitOps. CI workflow unchanged (Hugh owns .github/workflows/).
42 lines
1.5 KiB
Bash
Executable File
42 lines
1.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# teardown-e2e-headlamp.sh
|
|
#
|
|
# Tears down the dedicated E2E Headlamp instance deployed by deploy-e2e-headlamp.sh.
|
|
#
|
|
# RBAC is managed via Flux from privilegedescalation/infra/base/rbac/e2e-ci-runner-headlamp-rbac.yaml.
|
|
# The infra repo is the source of truth — do not apply this file directly.
|
|
#
|
|
# Environment:
|
|
# E2E_NAMESPACE — namespace to clean up (default: headlamp-plugins-e2e)
|
|
# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e)
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
E2E_NAMESPACE="${E2E_NAMESPACE:-headlamp-plugins-e2e}"
|
|
E2E_RELEASE="${E2E_RELEASE:-headlamp-e2e}"
|
|
|
|
echo "=== E2E Headlamp Teardown ==="
|
|
echo " Namespace: $E2E_NAMESPACE"
|
|
echo " Release: $E2E_RELEASE"
|
|
|
|
echo "Removing Headlamp Deployment, Service, and ServiceAccount..."
|
|
kubectl delete deployment "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found
|
|
kubectl delete service "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found
|
|
kubectl delete serviceaccount "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found
|
|
|
|
echo "Cleaning up ConfigMap..."
|
|
kubectl delete configmap headlamp-intel-gpu-plugin -n "$E2E_NAMESPACE" --ignore-not-found
|
|
|
|
echo "Cleaning up test service account..."
|
|
kubectl delete serviceaccount headlamp-e2e-test -n "$E2E_NAMESPACE" --ignore-not-found
|
|
|
|
# Clean up .env.e2e if present
|
|
if [ -f "$REPO_ROOT/.env.e2e" ]; then
|
|
rm "$REPO_ROOT/.env.e2e"
|
|
echo "Removed .env.e2e"
|
|
fi
|
|
|
|
echo ""
|
|
echo "E2E teardown complete."
|