202ce66c61
The E2E workflow and deploy scripts were targeting the legacy privilegedescalation-dev namespace, which is not managed by Flux GitOps in privilegedescalation/infra. The infra repo (PR #11) already provisions the headlamp-dev namespace and corresponding RBAC (e2e-ci-runner-headlamp-rbac.yaml) that grants the ARC runner SA (runners-privilegedescalation-gha-rs-no-permission in arc-runners) the permissions needed to deploy/teardown the E2E Headlamp instance. This change aligns all E2E infrastructure to use headlamp-dev: - .github/workflows/e2e.yaml: E2E_NAMESPACE=headlamp-dev - scripts/deploy-e2e-headlamp.sh: default namespace and comments - scripts/teardown-e2e-headlamp.sh: default namespace - deployment/e2e-ci-runner-rbac.yaml: namespace and add missing events permission (already present in infra copy) Refs: PRI-423 Co-authored-by: Chris Farhood <chris@farhood.org> Co-authored-by: Paperclip <noreply@paperclip.ing>
35 lines
1.2 KiB
Bash
Executable File
35 lines
1.2 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.
|
|
#
|
|
# Environment:
|
|
# E2E_NAMESPACE — namespace to clean up (default: headlamp-dev)
|
|
# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e)
|
|
set -euo pipefail
|
|
|
|
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
|
|
E2E_NAMESPACE="${E2E_NAMESPACE:-headlamp-dev}"
|
|
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-polaris-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 local env file
|
|
rm -f "$REPO_ROOT/.env.e2e"
|
|
|
|
echo "Teardown complete."
|