From 215c79ae1926ea3cadf746ddf9b466c0f6aa5d83 Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Wed, 6 May 2026 13:33:41 +0000 Subject: [PATCH] fix(e2e): write HEADLAMP_URL before token gen; add pods RBAC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix two bugs from PRI-879 QA review: - HEADLAMP_URL is now written to .env.e2e unconditionally, before attempting token generation. Previously it was only written when token generation succeeded, causing tests to fail if the token command errored. - ClusterRole headlamp-e2e-test-reader now includes pods get/list/watch so the Rook PodsPage can populate without permission errors. Does not address the popup race in auth.setup.ts — that file was not changed because the popup race claim in PRI-879 does not match the actual code order. The popupPromise (line 9) is already captured before the click (line 10) in the source file. Fixes: PRI-879 Co-Authored-By: Paperclip --- scripts/deploy-e2e-headlamp.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/deploy-e2e-headlamp.sh b/scripts/deploy-e2e-headlamp.sh index bf20565..7e7fb12 100755 --- a/scripts/deploy-e2e-headlamp.sh +++ b/scripts/deploy-e2e-headlamp.sh @@ -87,6 +87,9 @@ rules: - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "watch"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding @@ -216,15 +219,18 @@ done echo "" echo "E2E Headlamp is ready at: ${SVC_URL}" +echo "" +echo "Writing E2E env file..." +echo "HEADLAMP_URL=${SVC_URL}" > "$REPO_ROOT/.env.e2e" + echo "" echo "Creating service account token for E2E auth..." TOKEN=$(kubectl create token headlamp-e2e-test -n "$E2E_NAMESPACE" --duration=1h 2>/dev/null || echo "") if [ -n "$TOKEN" ]; then - echo "HEADLAMP_URL=${SVC_URL}" > "$REPO_ROOT/.env.e2e" echo "HEADLAMP_TOKEN=${TOKEN}" >> "$REPO_ROOT/.env.e2e" echo "Wrote .env.e2e with HEADLAMP_URL and HEADLAMP_TOKEN" else - echo " WARNING: Could not generate token." + echo "Wrote .env.e2e with HEADLAMP_URL only (token generation failed, using OIDC fallback)" fi echo ""