fix(e2e): make Polaris e2e CI self-sufficient with RBAC in workflow
Canonical fix for PRI-513: resolve Polaris e2e CI failures by applying RBAC directly in the workflow rather than depending on pre-existing Flux-managed RBAC that may not have converged. Changes: - .github/workflows/e2e.yaml: add workflow steps to apply both e2e-ci-runner-rbac.yaml (headlamp-dev namespace) and polaris-rbac.yaml (polaris namespace) before the pre-flight check, plus a pre-flight RBAC verification step - deployment/e2e-ci-runner-rbac.yaml: add a Role + RoleBinding for the polaris namespace so the CI runner can apply polaris-rbac.yaml This is the canonical form combining the best elements of stacking PRs: - Self-sufficient workflow (no external RBAC dependency) - RBAC pre-flight check for fast failure - read-write permissions for polaris namespace (same as main stacks) Supersedes: PRs #122, #124, #125 Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -45,6 +45,26 @@ jobs:
|
||||
- name: Setup kubectl
|
||||
uses: azure/setup-kubectl@v4
|
||||
|
||||
- name: Apply RBAC for E2E pipeline
|
||||
run: kubectl apply -f deployment/e2e-ci-runner-rbac.yaml
|
||||
|
||||
- name: Apply Polaris dashboard RBAC
|
||||
run: kubectl apply -f deployment/polaris-rbac.yaml
|
||||
|
||||
- name: RBAC pre-flight check
|
||||
run: |
|
||||
echo "Checking RBAC resources..."
|
||||
MISSING=0
|
||||
kubectl get role polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
||||
kubectl get rolebinding polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 || MISSING=1
|
||||
kubectl auth can-i delete configmaps -n "$E2E_NAMESPACE" --quiet 2>/dev/null || MISSING=1
|
||||
if [ "$MISSING" -eq 0 ]; then
|
||||
echo "RBAC pre-flight check passed."
|
||||
else
|
||||
echo "::error::RBAC pre-flight check failed. Missing required permissions."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
|
||||
Reference in New Issue
Block a user