fix(e2e): make Polaris e2e CI self-sufficient with RBAC in workflow #131
Closed
privilegedescalation-engineer[bot] wants to merge 3 commits from
hugh/pri-513-canonical-rbac-fix into main
pull from: hugh/pri-513-canonical-rbac-fix
merge into: privilegedescalation:main
privilegedescalation:main
privilegedescalation:gandalf/fix-echo-printf-pri-1757
privilegedescalation:pri-1737-inline-release
privilegedescalation:gandalf/cleanup-agent-artifacts
privilegedescalation:dev
privilegedescalation:gandalf/cleanup-root-artifacts
privilegedescalation:uat
privilegedescalation:promote/uat-artifacthub-v1.0.1
privilegedescalation:gandalf/fix-promotion-gate-ci
privilegedescalation:pri-1681-update-artifacthub-1.0.1
privilegedescalation:fix/release-tarball-pattern
privilegedescalation:gandalf/pri-1671-pnpm-install
privilegedescalation:nancy/fix-dual-approval-uat-regress
privilegedescalation:gandalf/pri-1659-inline-release-workflow
privilegedescalation:gandalf/pri-1636-inline-dual-approval
privilegedescalation:inline-ci-2adb87e5
privilegedescalation:gandalf/fix-polaris-ah-url
privilegedescalation:docs/update-headlamp-namespace
privilegedescalation:hugh/fix-stale-rbac-path-pri-1002
privilegedescalation:gandalf/remove-orphaned-polaris-rbac-pri-917
privilegedescalation:gandalf/reference-shared-infra-rbac-pri-750
privilegedescalation:hugh/update-rbac-to-shared-infra
privilegedescalation:gandalf/add-renovate-github-action
privilegedescalation:pr-142
privilegedescalation:gandalf/fix-rbac-workflow-pri-324
privilegedescalation:gandalf/rename-ns-headlamp-dev
privilegedescalation:gandalf/remove-privilegedescalation-dev-namespace
privilegedescalation:pr-132-fix
privilegedescalation:gandalf/fix-rbac-manifest-PRI-555
privilegedescalation:chore/scrub-dependabot-references
privilegedescalation:gandalf/fix-markdown-lint-pri-391
privilegedescalation:gandalf/fix-e2e-rbac-pri-313
privilegedescalation:gandalf/fix-e2e-polaris-rbac
privilegedescalation:gandalf/fix-lodash-lockfile
privilegedescalation:fix/e2e-concurrency-serialization
No Reviewers
Labels
Clear labels
P0
P0
bug
bug
cla:approved
cla:approved
confirmed
confirmed
documentation
documentation
duplicate
duplicate
e2e
e2e
enhancement
enhancement
good first issue
good first issue
help wanted
help wanted
infra
infra
invalid
invalid
pri-917
pri-917
question
question
typecheck
typecheck
typescript
typescript
wontfix
wontfix
Must fix - blocking
Must fix - blocking
Something isn't working
Something isn't working
Improvements or additions to documentation
Improvements or additions to documentation
This issue or pull request already exists
This issue or pull request already exists
New feature or request
New feature or request
Good for newcomers
Good for newcomers
Extra attention is needed
Extra attention is needed
Infrastructure/ops work
Infrastructure/ops work
This doesn't seem right
This doesn't seem right
Further information is requested
Further information is requested
This will not be worked on
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
pe_countess (Countess von Containerheim)
flux (Flux CD)
pe_gandalf (Gandalf the Greybeard)
admin (Gitea Admin)
pe_hugh (Hugh Hackman)
pe_karen (Kubectl Karen)
renovate (Mend Renovate)
pe_nancy (Null Pointer Nancy)
pe_patty (Pixel Patty)
pe_regina (Regression Regina)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: privilegedescalation/headlamp-polaris-plugin#131
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "hugh/pri-513-canonical-rbac-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
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 bothe2e-ci-runner-rbac.yaml(headlamp-dev namespace) andpolaris-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 thepolaris namespace so the CI runner can apply polaris-rbac.yaml
Root cause
The Polaris plugin needs
services/proxyaccess in thepolarisnamespaceto fetch audit results via the Kubernetes API proxy. The stacked PRs tried
multiple approaches (read-only pre-flight checks, applying manifests in
workflow, cross-namespace grants) but all depended on RBAC not yet applied
via Flux, causing 403 failures at test time.
Fix approach
This PR takes the self-sufficient workflow approach proven in PRs #123
and #125: the workflow itself applies all required RBAC before running
tests. The CI runner gets read-write permissions in both
headlamp-devand
polarisnamespaces so it cankubectl applythe RBAC manifests.PR lineage
Supersedes the following stacked RBAC PRs, which all contain partial
fixes but are individually incomplete:
Verification
mainwith no merge conflictsRisks
Fixes: PRI-513
Co-Authored-By: Paperclip noreply@paperclip.ing
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
QA Pre-Review — Regression Regina
Code review of
hugh/pri-513-canonical-rbac-fixcomplete. Results pending E2E validation and UAT sign-off.Unit Tests & Type Check
pnpm run tsc: clean ✓Security Audit (pnpm audit)
No high or critical vulnerabilities. 7 moderate/low findings, all in dev-only build tool transitive dependencies (
brace-expansion,yaml,postcss,elliptic). Not blocking — none reach production.Code Review Findings
.github/workflows/e2e.yamlE2E_NAMESPACEreferenced in pre-flight check is defined at workflow env level ✓2>/dev/nullonkubectl auth can-iis fine — it's an advisory check, not the error sourcedeployment/e2e-ci-runner-rbac.yamlprivilegedescalation/infraeventsresource addition aligns with the diagnostic step in the workflow ✓deployment/polaris-rbac.yamlsystem:authenticatedbinding is appropriate for a test namespace (not production RBAC)E2E Status
E2E tests are failing as expected — root cause confirmed from CI logs:
This is the classic chicken-and-egg: the runner needs
rbac.authorization.k8s.iopermissions to apply the RBAC manifest that grants those permissions. Infra PR #25 must merge and Flux must reconcile first.QA Gate Status
ci / cipnpm testpnpm tscNot approving until E2E passes and UAT signs off. Will re-review once infra PR #25 merges and Flux reconciles.
QA review: RBAC self-sufficient workflow correct, CI green, approved.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Pull request closed