Skip to content

OCPBUGS-65469: Add debug-useful ClusterOperator relatedObjects#459

Open
RadekManak wants to merge 1 commit into
openshift:mainfrom
RadekManak:add-clusterrole-to-relatedobjects
Open

OCPBUGS-65469: Add debug-useful ClusterOperator relatedObjects#459
RadekManak wants to merge 1 commit into
openshift:mainfrom
RadekManak:add-clusterrole-to-relatedobjects

Conversation

@RadekManak

@RadekManak RadekManak commented May 6, 2026

Copy link
Copy Markdown
Contributor

Expand cloud-controller-manager ClusterOperator relatedObjects so must-gather / oc adm inspect pick up RBAC that namespace inspect does not collect.

Keeps the existing ClusterOperator + namespace entries and adds debug-useful cluster-scoped / foreign-namespace RBAC (not a full inventory of every managed object).

Added relatedObjects

  • ClusterRoles: system:openshift:operator:cloud-controller-manager, cloud-controller-manager, cloud-node-manager
  • ClusterRoleBindings: matching bindings above, plus SCC hostaccess for the operator
  • Roles / RoleBindings in openshift-config, openshift-config-managed, and kube-system

Runtime

Platform-specific relatedObjects (provider ClusterRoles/CRBs, admission policies, etc.) are appended from Infrastructure at reconcile time.

Tests

Parity test keeping the static Go list in sync with the ClusterOperator manifest.

@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low 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 May 6, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@RadekManak: This pull request references Jira Issue OCPBUGS-65469, which is invalid:

  • expected the bug to target either version "5.0." or "openshift-5.0.", but it targets "4.21.z" instead

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:

Adds all resources managed by the cloud-controller-manager operator to the ClusterOperator's relatedObjects list, ensuring oc adm inspect and must-gather collect the complete set of resources needed for debugging.

Resources added

  • ConfigMaps (cloud-controller-manager-images, kube-rbac-proxy)
  • Services, Deployments
  • NetworkPolicies
  • ServiceAccounts
  • Roles and RoleBindings (operator, openshift-config, openshift-config-managed, kube-system namespaces)
  • ClusterRoles and ClusterRoleBindings (operator, cloud-node-manager, openstack-cloud-controller-manager)
  • CredentialsRequests (Azure, GCP, IBM, Nutanix, OpenStack, PowerVS, vSphere)

Also fixes the namespace ordering to list the operator namespace (openshift-cloud-controller-manager-operator) before the managed namespace (openshift-cloud-controller-manager).

Both the static manifest YAML and the Go source are kept in sync.

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.

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown

Walkthrough

The change expands status.relatedObjects in the controller and corresponding ClusterOperator manifest to include broader cluster-scoped and namespace-scoped resources, especially RBAC objects across several namespaces.

Changes

Related object reporting

Layer / File(s) Summary
Expanded related object inventory
pkg/controllers/status.go, manifests/..._60_clusteroperator.yaml
The controller returns a larger set of ObjectReference entries, while the manifest adds cluster roles, bindings, roles, and rolebindings across the operator, configuration, and system namespaces.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: nrb, racheljpg

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Added Ginkgo title is static and descriptive; no dynamic values, timestamps, or generated identifiers appear in touched tests.
Test Structure And Quality ✅ Passed No Ginkgo test code was modified; the PR only touches controller status logic and a manifest, so the test-structure check is not applicable.
Microshift Test Compatibility ✅ Passed No e2e tests were added; the new Ginkgo tests are unit tests under pkg/controllers, so this MicroShift check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed New Ginkgo tests are unit/manifest-sync checks; they don’t assume multiple nodes or HA, so no SNO-specific guard is needed.
Topology-Aware Scheduling Compatibility ✅ Passed Changed files only expand ClusterOperator relatedObjects and sync the manifest; no node selectors, affinity, spread, replicas, or topology assumptions were added.
Ote Binary Stdout Contract ✅ Passed PASS: Diff only expands relatedObjects helpers and Ginkgo It tests; no main/init/TestMain/BeforeSuite code or stdout writes were added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new e2e/network-sensitive tests were added; the new Ginkgo test only reads a local manifest and compares relatedObjects, with no IPv4 or external connectivity assumptions.
No-Weak-Crypto ✅ Passed No weak crypto primitives, custom crypto, or secret comparisons were added in the changed Go or manifest files.
Container-Privileges ✅ Passed No privileged/hostPID/hostNetwork/hostIPC/allowPrivilegeEscalation/SYS_ADMIN fields were added; the PR only expands relatedObjects and sync tests.
No-Sensitive-Data-In-Logs ✅ Passed Changed code only expands relatedObjects; existing klog messages are generic and do not log secrets, PII, or hostnames.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main change: expanding ClusterOperator relatedObjects for debugging.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from nrb and racheljpg May 6, 2026 13:52
@openshift-ci

openshift-ci Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign racheljpg for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 9, 2026
Expand status.relatedObjects and the ClusterOperator manifest seed so
oc adm inspect / must-gather collect cluster-scoped RBAC, foreign-namespace
Roles/RoleBindings, CredentialsRequests, and the SCC hostaccess binding.

Keep a static debug-oriented core in sync with the manifest (parity test),
and append platform-specific relatedObjects from Infrastructure at runtime.
@RadekManak
RadekManak force-pushed the add-clusterrole-to-relatedobjects branch from f418143 to 9a00b1c Compare July 13, 2026 15:49
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 13, 2026
@RadekManak

Copy link
Copy Markdown
Contributor Author

/retest

@RadekManak RadekManak changed the title OCPBUGS-65469: Add all managed resources to ClusterOperator relatedObjects OCPBUGS-65469: Add debug-useful ClusterOperator relatedObjects Jul 13, 2026
@RadekManak

Copy link
Copy Markdown
Contributor Author

/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

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

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

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

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.

@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@openshift-ci-robot: GitHub didn't allow me to request PR reviews from the following users: sunzhaohua2.

Note that only openshift members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

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

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

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

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.

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.

@RadekManak

Copy link
Copy Markdown
Contributor Author

/retest-required

@openshift-ci

openshift-ci Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@RadekManak: 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.

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

Labels

jira/severity-low Referenced Jira bug's severity is low 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants