Skip to content

fix(ci): mount real conditional policies in operator RBAC deployments [release-1.9] - #5441

Open
gustavolira wants to merge 6 commits into
redhat-developer:release-1.9from
gustavolira:fix/operator-rbac-conditional-policies-1.9
Open

gustavolira wants to merge 6 commits into
redhat-developer:release-1.9from
gustavolira:fix/operator-rbac-conditional-policies-1.9

Conversation

@gustavolira

Copy link
Copy Markdown
Member

Description

The release-1.9 showcase-rbac project has been failing on operator-based nightlies (gke-operator et al.) with RBAC tests seeing 0 permissions and an empty catalog (RHDHBUGS-3773, RHDHBUGS-3538).

Root cause

create_conditional_policies_operator extracts the conditional policies from .upstream.backstage.initContainers[0].command[2] in values_showcase-rbac.yaml — but that section was removed in February by #4162, which moved the policies to the static resources/config_map/conditional-policies.yaml. Since then the yq path resolves to null and every operator RBAC deployment mounts an empty conditional-policies.yaml (Helm deployments mount the real file, which is why helm RBAC passes).

Without conditional policies, the test users lose their conditional catalog.entity read/update/delete grants: role pages show 0 permissions and the catalog renders empty — exactly the $currentUser / $ownerRefs / policyDecisionPrecedence failures in the nightly (verified against the 2026-09-18 gke-operator run artifacts).

Fix

Backport main's behavior: always create the rbac-policy ConfigMap from the static conditional-policies.yaml, and remove the dead helper plus its five call sites.

Also fixes the default RBAC GitHub App env block in env_variables.sh: GITHUB_APP_PRIVATE_KEY_RBAC read the client secret (JWT minting can never succeed) and GITHUB_APP_CLIENT_SECRET_RBAC was missing. These defaults kick in whenever the per-run prefix rotation finds an incomplete secret set, then GitHub discovery/bulk-import fail with 401s.

Verification

bash -n on all touched scripts, yarn shellcheck and yarn prettier:check green; no references to the removed helper remain.

🤖 Generated with Claude Code

create_conditional_policies_operator extracted the conditional policies
from .upstream.backstage.initContainers in values_showcase-rbac.yaml, but
that section was removed in February (redhat-developer#4162) when the policies moved to
the static resources/config_map/conditional-policies.yaml. Since then the
yq path resolves to null and every operator-based RBAC deployment (OCP,
OSD, GKE, AKS, EKS) mounts an EMPTY conditional-policies.yaml, while Helm
deployments mount the real file.

With no conditional policies, test users lose their conditional
catalog.entity read/update/delete grants: the RBAC role pages show 0
permissions and the catalog looks empty to them, which is exactly the
failure mode of the rbac.spec.ts $currentUser, $ownerRefs and
policyDecisionPrecedence tests in the gke-operator nightly
(RHDHBUGS-3773 evidence trail).

Align with main: always mount the static conditional-policies.yaml and
drop the dead helper and its call sites.

Also fix the default RBAC GitHub App env block: PRIVATE_KEY_RBAC was
reading the CLIENT_SECRET secret (an app JWT can never be minted from
that), and CLIENT_SECRET_RBAC was missing entirely. The defaults are used
whenever the per-run prefix rotation finds an incomplete secret set, and
then break GitHub discovery/bulk-import with 401s.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gustavolira

Copy link
Copy Markdown
Member Author

/test ?

@gustavolira

Copy link
Copy Markdown
Member Author

/test e2e-gke-operator-nightly

@gustavolira

Copy link
Copy Markdown
Member Author

/test e2e-ocp-operator-nightly

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@gustavolira

Copy link
Copy Markdown
Member Author

Validation run of periodic-ci-redhat-developer-rhdh-release-1.9-e2e-gke-operator-nightly against this branch: build 2100941036816699392.

showcase-rbac went from 8 failures (last nightly on release-1.9) to 2, and every test this PR targets now passes:

  • RBAC $currentUser conditional policy — pass
  • RBAC $ownerRefs / includeTransitiveGroupOwnership — pass
  • RBAC policyDecisionPrecedence (all 3 cases) — pass
  • "permission policies defined in files" (3 Permissions heading) — pass
  • Bulk Import "Verify Added Repositories Appear in the Catalog" — pass
  • Auditor condition-read — pass

The 2 remaining failures are the known, independent Kubernetes plugin span[aria-label="Status ok"].nth(4) locator issue tracked in RHDHBUGS-3775 — unrelated to conditional policies. showcase (non-RBAC): 99 tests, 0 failures.

gustavolira and others added 2 commits September 18, 2026 12:57
verifyPodLogs located the deployment's pod-count chip with a page-wide
span[aria-label="Status ok"] nth(4). The page-wide chip count depends on
what the cluster happens to contain and on the user's RBAC visibility;
the current Kubernetes tab renders only 4 chips (2 on the cluster
summary, 2 on the deployment), so nth(4) waits for a fifth chip that no
longer exists and both kubernetes-rbac tests time out (RHDHBUGS-3775).

Locate the chip inside the deployment's own accordion summary button
instead, matched by its accessible name, so the assertion is unaffected
by other resources appearing or disappearing. Verified against the
accessibility snapshots (error-context.md) of the failed
release-1.9-e2e-gke-operator-nightly runs: the scoped locator resolves
in both the permitted and the restricted user scenarios.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… accordion

Review hardening: exact accessible-name matching, and filter the nested
same-named buttons by the chip they must contain instead of taking the
first DOM match.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gustavolira

Copy link
Copy Markdown
Member Author

Folded #5445 (the Kubernetes pod-status locator fix) into this PR so a single e2e-gke-operator-nightly run can demonstrate showcase-rbac fully green — each fix alone left the other's failures red on the job. Retriggering both operator jobs.

/test e2e-gke-operator-nightly
/test e2e-ocp-operator-nightly

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@gustavolira

Copy link
Copy Markdown
Member Author

The e2e-ocp-operator-nightly failure is the known infra race RHDHBUGS-3758 — the operator install script patches the image registry and reads default-route before OpenShift creates it (routes.route.openshift.io "default-route" not found); nothing was deployed. The previous run of this same job reached the tests and validated this PR's fix (all conditional-policy tests green). Retesting.

/test e2e-ocp-operator-nightly

…r install

install-rhdh-catalog-source.sh patches the cluster image registry and
immediately reads the default-route, which OpenShift takes a few seconds
to create — the known RHDHBUGS-3758 race that intermittently fails the
operator install with 'routes.route.openshift.io "default-route" not
found'. Expose the registry up front and wait for the route so the
script's own read finds it; warn-only on timeout so the existing retry
loop keeps its chance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

The container image build and publish workflows were skipped (either due to [skip-build] tag or no relevant changes with existing image).

@gustavolira

Copy link
Copy Markdown
Member Author

/test e2e-ocp-operator-nightly

gustavolira and others added 2 commits September 18, 2026 17:43
The Route object existing is not enough: right after creation the
router/registry data path can still refuse blob uploads (EOF on the
operator bundle push, RHDHBUGS-3759). Poll the registry API through the
route until it answers 200/401 before handing off to the install script.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…role

'Create and edit a role from the roles list page' intermittently fails
with the Save button never appearing: the edit wizard's stepper
re-renders between steps, so the single click on nextButton-2 can land
on a stale node and silently not advance — the accessibility snapshot of
the failed runs shows the wizard still on the permission-policies step
showing Back/Next. The failure then cascades: test-role leaks past the
test's own cleanup and breaks the GET-comparison and IsOwner tests.

- RbacPo.advanceFromPermissionsToReview(): retry the Next click until the
  review step's Save button is visible/enabled (toPass), replacing the
  three copies of the blind click pattern.
- Pre-clean role:default/test-role before creating it in the two tests
  that own it, so retries do not inherit a leaked role.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gustavolira

Copy link
Copy Markdown
Member Author

/test e2e-ocp-operator-nightly

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

The container image build workflow finished with status: cancelled.

@github-actions

Copy link
Copy Markdown
Contributor

Image was built and published successfully. It is available at:

@openshift-ci

openshift-ci Bot commented Sep 18, 2026

Copy link
Copy Markdown

@gustavolira: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ocp-operator-nightly 9c70657 link false /test e2e-ocp-operator-nightly

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant