diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4d5ceb2..cb1c4c5 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -45,31 +45,20 @@ jobs: - name: Setup kubectl uses: azure/setup-kubectl@v4 + - name: Apply RBAC for Polaris dashboard proxy + run: kubectl apply -f deployment/polaris-rbac.yaml + - name: RBAC pre-flight check run: | echo "Checking RBAC resources in polaris namespace..." - MISSING_ROLE=false - MISSING_ROLEBINDING=false - - if ! kubectl get role polaris-dashboard-proxy-reader -n polaris --quiet 2>/dev/null; then - echo "::error::Role polaris-dashboard-proxy-reader not found in polaris namespace." - MISSING_ROLE=true - fi - - if ! kubectl get rolebinding polaris-dashboard-proxy-reader -n polaris --quiet 2>/dev/null; then - echo "::error::RoleBinding polaris-dashboard-proxy-reader not found in polaris namespace." - MISSING_ROLEBINDING=true - fi - - if [ "$MISSING_ROLE" = true ] || [ "$MISSING_ROLEBINDING" = true ]; then - echo "" - echo "::error::RBAC not applied. Apply the RBAC manifests before running E2E tests:" - echo "::error:: kubectl apply -f deployment/polaris-rbac.yaml" + if kubectl get role polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1 && \ + kubectl get rolebinding polaris-dashboard-proxy-reader -n polaris -o name >/dev/null 2>&1; then + echo "RBAC pre-flight check passed." + else + echo "::error::Role or RoleBinding not found in polaris namespace after apply." exit 1 fi - echo "RBAC pre-flight check passed." - - name: Install dependencies run: npm ci