Skip to content

OCPBUGS-65469: Add all managed resources to ClusterOperator relatedObjects#459

Open
RadekManak wants to merge 2 commits intoopenshift:mainfrom
RadekManak:add-clusterrole-to-relatedobjects
Open

OCPBUGS-65469: Add all managed resources to ClusterOperator relatedObjects#459
RadekManak wants to merge 2 commits intoopenshift:mainfrom
RadekManak:add-clusterrole-to-relatedobjects

Conversation

@RadekManak
Copy link
Copy Markdown
Contributor

@RadekManak RadekManak commented May 6, 2026

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.

Summary by CodeRabbit

  • Chores
    • Expanded cluster operator status reporting to provide more comprehensive tracking of operator-managed resources and components across multiple system namespaces, improving system visibility and diagnostics.

RadekManak and others added 2 commits November 12, 2025 17:44
This adds the cloud-controller-manager ClusterRole to the
ClusterOperator's relatedObjects to ensure it's collected by oc adm
inspect and must-gather for debugging purposes.

The name field is set to the specific ClusterRole name since the
operator manages a single ClusterRole resource.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add configmaps, services, deployments, networkpolicies, serviceaccounts,
roles, rolebindings, clusterrolebindings, and credentialsrequests to the
relatedObjects list so that oc adm inspect and must-gather collect the
full set of resources managed by the operator.

Also fixes the namespace ordering to list the operator namespace before
the managed namespace.
@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
Copy link
Copy Markdown

coderabbitai Bot commented May 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: feae1c7d-81d4-4f0d-9729-9a482140e649

📥 Commits

Reviewing files that changed from the base of the PR and between ff92368 and f418143.

📒 Files selected for processing (2)
  • manifests/0000_26_cloud-controller-manager-operator_12_clusteroperator.yaml
  • pkg/controllers/status.go

Walkthrough

The pull request expands the cloud-controller-manager operator's relatedObjects tracking by adding comprehensive resource references across multiple namespaces and reordering existing entries. The implementation logic in status.go is updated to return a larger set of ObjectReference entries, and the corresponding manifest declaration is similarly expanded.

Changes

RelatedObjects Tracking Expansion

Layer / File(s) Summary
Status Tracking Implementation
pkg/controllers/status.go
The relatedObjects() method is expanded to return a substantially larger set of ObjectReference entries covering namespaces, configmaps, services, deployments, networkpolicies, RBAC objects, credentialsrequests, and serviceaccounts across multiple namespaces instead of a minimal placeholder list.
Manifest Declaration
manifests/0000_26_cloud-controller-manager-operator_12_clusteroperator.yaml
ClusterOperator status.relatedObjects is expanded with comprehensive entries enumerating resources across openshift-cloud-controller-manager-operator, openshift-cloud-controller-manager, kube-system, openshift-config, and openshift-config-managed namespaces. The operator namespace entry is reordered to appear before the cloud-controller-manager namespace entry.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 11 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning Tests lack timeouts (use context.TODO()), violate single responsibility by testing both behavior and idempotency in same test case, and one assertion has no descriptive message. Add timeout contexts for client operations, split multi-behavior tests into separate cases, add messages to all assertions, use table-driven sub-tests for better isolation.
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding managed resources to the ClusterOperator's relatedObjects field.
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 Check is not applicable to this PR - no Ginkgo test declarations were modified or added
Microshift Test Compatibility ✅ Passed PR does not add any Ginkgo e2e tests. Changes include only manifest updates and Go unit tests using standard testing package, not Ginkgo.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No Ginkgo e2e tests are added in this PR. Changes are limited to a YAML manifest file and Go source code for status management. The SNO Test Compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR only expands ClusterOperator.relatedObjects metadata listing. No new scheduling constraints, pod affinity, topology spread constraints, or deployment specs are introduced.
Ote Binary Stdout Contract ✅ Passed This PR is for the cloud-controller-manager operator, not an OTE test binary. Changes only update resource metadata and manifest files with no process-level stdout writes.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes are infrastructure updates to ClusterOperator resource configuration, not test code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.1)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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

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

openshift-ci Bot commented May 6, 2026

[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
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 6, 2026

@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/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants