Skip to content

[release-4.22] OCPBUGS-98603: Move RBAC manifests to the services that own them#7042

Merged
openshift-merge-bot[bot] merged 3 commits into
openshift:release-4.22from
openshift-cherrypick-robot:cherry-pick-7029-to-release-4.22
Jul 14, 2026
Merged

[release-4.22] OCPBUGS-98603: Move RBAC manifests to the services that own them#7042
openshift-merge-bot[bot] merged 3 commits into
openshift:release-4.22from
openshift-cherrypick-robot:cherry-pick-7029-to-release-4.22

Conversation

@openshift-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #7029

/assign pacevedom

The cluster-policy-controller RBAC was applied by
infrastructure-services-manager, forcing cluster-policy-controller to
depend on it. This created a deadlock on restart:
infrastructure-services-manager creates deployments whose SCC admission
blocks for up to 13s waiting for namespace UID-range annotations, but
those annotations are set by the namespace-security-allocation-controller
inside cluster-policy-controller, which cannot start until
infrastructure-services-manager finishes.

On a fresh boot this was masked because target namespaces did not exist
yet and the deployment create timed out at the client side, allowing a
retry after the annotations were set. On restart the namespaces already
exist, so the deployment create goes straight to admission and the
deadlock is exposed.

Move each service's RBAC into its own Run method:
- cluster-policy-controller applies its 6 RBAC manifests and drops the
  infrastructure-services-manager dependency, restoring the original
  dependency on kube-apiserver only
- kube-controller-manager applies its CSR approver RBAC alongside its
  own namespaces
- infrastructure-services-manager no longer applies RBAC for other
  services

Bug: https://issues.redhat.com/browse/OCPBUGS-98219
The previous commit broke the circular dependency but left a race:
infrastructure-services-manager could still submit deployment creates
before cluster-policy-controller had annotated namespaces with
openshift.io/sa.scc.uid-range, depending on CPU speed.

Start the controller in a goroutine and poll the default namespace
for the UID range annotation before signaling ready. Add
cluster-policy-controller as a dependency of
infrastructure-services-manager so that deployment creates are
guaranteed to pass SCC admission regardless of system load.

Bug: https://issues.redhat.com/browse/OCPBUGS-98219
- Use select on errCh and waitCh so that if the controller dies before
  the readiness poll completes, the error is surfaced immediately
  instead of blocking forever
- Log progress every 5 attempts during the readiness poll to make
  hangs diagnosable
- Fix comment: the annotation check guarantees SCC admission will not
  block, but does not prove the controller is running on restart (the
  annotation persists from the previous boot)
- Differentiate cluster role vs cluster role binding error messages
  in both CPC and KCM

Bug: https://issues.redhat.com/browse/OCPBUGS-98219
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 14103d9e-a3f9-424f-824f-af0659ff32dd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci-robot

Copy link
Copy Markdown

@openshift-cherrypick-robot: Jira Issue OCPBUGS-98219 has been cloned as Jira Issue OCPBUGS-98603. Will retitle bug to link to clone.
/retitle [release-4.22] OCPBUGS-98603: Move RBAC manifests to the services that own them

Details

In response to this:

This is an automated cherry-pick of #7029

/assign pacevedom

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from jerpeter1 and pmtk July 13, 2026 22:04
@openshift-ci openshift-ci Bot changed the title [release-4.22] OCPBUGS-98219: Move RBAC manifests to the services that own them [release-4.22] OCPBUGS-98603: Move RBAC manifests to the services that own them Jul 13, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 13, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@openshift-cherrypick-robot: This pull request references Jira Issue OCPBUGS-98603, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

This is an automated cherry-pick of #7029

/assign pacevedom

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 openshift-eng/jira-lifecycle-plugin repository.

@pacevedom

Copy link
Copy Markdown
Contributor

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 13, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@pacevedom: This pull request references Jira Issue OCPBUGS-98603, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-98219 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-98219 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@ggiguash

Copy link
Copy Markdown
Contributor

/lgtm
/verified by ci
/label backport-risk-assessed
/label jira/valid-bug

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Jul 14, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@ggiguash: This PR has been marked as verified by ci.

Details

In response to this:

/lgtm
/verified by ci
/label backport-risk-assessed
/label jira/valid-bug

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 14, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 14, 2026
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ggiguash, openshift-cherrypick-robot

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 14, 2026
@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@openshift-cherrypick-robot: all tests passed!

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.

@openshift-merge-bot openshift-merge-bot Bot merged commit ffe9781 into openshift:release-4.22 Jul 14, 2026
15 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@openshift-cherrypick-robot: Jira Issue OCPBUGS-98603: All pull requests linked via external trackers have merged:

All linked pull requests have the verified tag. Jira Issue OCPBUGS-98603 has been moved to the VERIFIED state.

Details

In response to this:

This is an automated cherry-pick of #7029

/assign pacevedom

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 openshift-eng/jira-lifecycle-plugin repository.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants