Skip to content

OCPBUGS-99774: remove redundant cluster-wide informer and unused kube-system registration - #966

Open
savio87 wants to merge 1 commit into
openshift:masterfrom
savio87:OCPBUGS-99774
Open

OCPBUGS-99774: remove redundant cluster-wide informer and unused kube-system registration#966
savio87 wants to merge 1 commit into
openshift:masterfrom
savio87:OCPBUGS-99774

Conversation

@savio87

@savio87 savio87 commented Aug 7, 2026

Copy link
Copy Markdown

Bug

https://redhat.atlassian.net/browse/OCPBUGS-99774

Problem

The cluster-authentication-operator has two informer cleanup issues:

  1. Redundant cluster-wide informer: A kubeInformers field (marked // TODO remove) creates a separate kubeinformers.NewSharedInformerFactory that duplicates the "" (cluster-wide) entry already in kubeInformersForNamespaces. It is only used for CertificateSigningRequests informer in two places.

  2. Unused namespace registration: kube-system is registered in kubeInformersForNamespaces but never queried via InformersFor("kube-system") anywhere in the operator, wasting a watch connection.

Fix

  • Migrate the two CSR informer usages in starter.go from informerFactories.kubeInformers to informerFactories.kubeInformersForNamespaces.InformersFor(""), which provides the same cluster-wide informer
  • Remove the kubeInformers field, its initialization, and its entry in simplifiedInformerFactories()
  • Remove the unused kubeinformers import
  • Remove kube-system from kubeInformersForNamespaces registration

Summary by CodeRabbit

  • Bug Fixes
    • Improved authentication operator monitoring by using the correct namespace configuration.
    • Added monitoring for the etcd endpoint namespace while removing unnecessary system namespace monitoring.
    • Updated certificate request and approval handling to consistently monitor cluster-wide signing requests.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@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 Aug 7, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@savio87: This pull request references Jira Issue OCPBUGS-99774, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

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:

Bug

https://redhat.atlassian.net/browse/OCPBUGS-99774

Problem

The cluster-authentication-operator has two informer cleanup issues:

  1. Redundant cluster-wide informer: A kubeInformers field (marked // TODO remove) creates a separate kubeinformers.NewSharedInformerFactory that duplicates the "" (cluster-wide) entry already in kubeInformersForNamespaces. It is only used for CertificateSigningRequests informer in two places.

  2. Unused namespace registration: kube-system is registered in kubeInformersForNamespaces but never queried via InformersFor("kube-system") anywhere in the operator, wasting a watch connection.

Fix

  • Migrate the two CSR informer usages in starter.go from informerFactories.kubeInformers to informerFactories.kubeInformersForNamespaces.InformersFor(""), which provides the same cluster-wide informer
  • Remove the kubeInformers field, its initialization, and its entry in simplifiedInformerFactories()
  • Remove the unused kubeinformers import
  • Remove kube-system from kubeInformersForNamespaces registration

Made with Cursor

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 Aug 7, 2026

Copy link
Copy Markdown

Walkthrough

The operator removes the shared Kubernetes informer from authentication informer setup. It updates watched namespaces and routes certificate signing request consumers through the namespace-aware informer factory.

Changes

Informer wiring

Layer / File(s) Summary
Informer factory configuration
pkg/operator/replacement_starter.go
Removes the shared Kubernetes informer, removes kube-system from the namespace list, and retains the etcd endpoint namespace.
Certificate request informer consumers
pkg/operator/starter.go
Updates the authenticator certificate requester and webhook certificate approver to use the namespace-aware certificate signing request informer.

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

Suggested reviewers: tjungblu

🚥 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 The PR changes only two non-test Go files; no Ginkgo declarations or test-title changes are present in the diff.
Test Structure And Quality ✅ Passed The PR changes only two production Go files and adds no Ginkgo tests, It blocks, resource setup, waits, or assertions to assess.
Microshift Test Compatibility ✅ Passed The pull request changes only informer setup in two operator files and adds no Ginkgo e2e tests, so the MicroShift test compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The patch changes only two operator Go files, adds no test files, and adds no Ginkgo It, Describe, Context, or When constructs.
Topology-Aware Scheduling Compatibility ✅ Passed The PR changes only informer setup and CSR informer sources; it adds no scheduling constraints, manifests, replicas, affinity, selectors, tolerations, or PDBs.
Ote Binary Stdout Contract ✅ Passed OTE main calls klog.LogToStderr(true) before setup; the PR only changes informer wiring, and no process-level stdout writes were added. Helper fmt.Printf calls run in test cases.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No Ginkgo e2e tests were added or modified; the diff only changes informer setup and CSR informer selection, so IPv6 or external-connectivity test risks do not apply.
No-Weak-Crypto ✅ Passed The patch only removes informer setup and changes CSR informer sources; no MD5, SHA-1, DES, RC4, Blowfish, ECB, custom crypto, or secret comparisons were added.
Container-Privileges ✅ Passed The PR changes only Go informer wiring; no container or Kubernetes manifest changes are present, so the privilege conditions are not introduced.
No-Sensitive-Data-In-Logs ✅ Passed The patch only changes informer wiring and removes an unused factory; it adds no logging calls or sensitive-data log fields.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the removal of the redundant cluster-wide informer and unused kube-system registration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci

openshift-ci Bot commented Aug 7, 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 ricardomaraschini 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 requested review from gangwgr and ingvagabund August 7, 2026 06:15
@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 7, 2026
@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Hi @savio87. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@savio87

savio87 commented Aug 7, 2026

Copy link
Copy Markdown
Author

This removes a redundant cluster-wide informer (marked // TODO remove) and an unused kube-system namespace registration. The CSR informer usage is migrated to the existing cluster-wide entry in kubeInformersForNamespaces. Could a maintainer please set the target version on OCPBUGS-99774 and run /ok-to-test? Thank you!

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants