Skip to content

CNTRLPLANE-3384: Remove unconditional low-quality log messages from controllers#8428

Open
csrwng wants to merge 1 commit intoopenshift:mainfrom
csrwng:cntrlplane-3384-remove-low-quality-logs
Open

CNTRLPLANE-3384: Remove unconditional low-quality log messages from controllers#8428
csrwng wants to merge 1 commit intoopenshift:mainfrom
csrwng:cntrlplane-3384-remove-low-quality-logs

Conversation

@csrwng
Copy link
Copy Markdown
Contributor

@csrwng csrwng commented May 5, 2026

Summary

  • Remove unconditional log.Info("Reconciling"), log.Info("reconciliation complete"), and equivalent messages from 18 controllers across the CPO and HO
  • Clean up unused variables and imports resulting from the removal

Context

These log messages provide no actionable information and are emitted on every reconcile invocation, including frequent re-queues. controller-runtime already provides reconcile lifecycle tracing at debug verbosity. In management clusters running many HostedClusters (e.g., ARO HCP), this produces significant log noise that obscures meaningful events during incident investigation.

Identified during a debugging session investigating cluster deletion issues in the managed Azure service (ARO HCP).

Jira

https://issues.redhat.com/browse/CNTRLPLANE-3384

Test plan

  • Verify no meaningful or conditional log messages were removed
  • Verify unused variables and imports are cleaned up
  • make test passes
  • make build passes

Summary by CodeRabbit

  • Chores
    • Removed verbose informational logging from multiple controllers to reduce log output and improve operational efficiency.

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

openshift-ci Bot commented May 5, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 5, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 5, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented May 5, 2026

@csrwng: This pull request references CNTRLPLANE-3384 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Remove unconditional log.Info("Reconciling"), log.Info("reconciliation complete"), and equivalent messages from 18 controllers across the CPO and HO
  • Clean up unused variables and imports resulting from the removal

Context

These log messages provide no actionable information and are emitted on every reconcile invocation, including frequent re-queues. controller-runtime already provides reconcile lifecycle tracing at debug verbosity. In management clusters running many HostedClusters (e.g., ARO HCP), this produces significant log noise that obscures meaningful events during incident investigation.

Identified during a debugging session investigating cluster deletion issues in the managed Azure service (ARO HCP).

Jira

https://issues.redhat.com/browse/CNTRLPLANE-3384

Test plan

  • Verify no meaningful or conditional log messages were removed
  • Verify unused variables and imports are cleaned up
  • make test passes
  • make build passes

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 added do-not-merge/needs-area area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform and removed do-not-merge/needs-area labels May 5, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: csrwng

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 May 5, 2026
These log messages (e.g. log.Info("Reconciling"), log.Info("reconcile
complete")) provide no clear information and are emitted on every
reconcile invocation, leading to excessive log noise. controller-runtime
already provides reconcile lifecycle tracing at debug verbosity.

Remove entry/exit logs and sub-function announcement logs from 18
controllers across the CPO and HO. Clean up unused variables and
imports where applicable.

Signed-off-by: Cesar Wong <cewong@redhat.com>
Commit-Message-Assisted-by: Claude (via Claude Code)
@csrwng csrwng force-pushed the cntrlplane-3384-remove-low-quality-logs branch from 1f358a6 to fc7aa60 Compare May 5, 2026 19:40
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 34a34aa9-8dc1-4289-9c7e-6083c1abe334

📥 Commits

Reviewing files that changed from the base of the PR and between 2d3b34d and fc7aa60.

📒 Files selected for processing (18)
  • control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go
  • control-plane-operator/controllers/gcpprivateserviceconnect/observer.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/nodecount/controller.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/registry/admissionpolicies.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go
  • hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
  • hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_validation_controller.go
  • hypershift-operator/controllers/nodepool/nodepool_controller.go
  • hypershift-operator/controllers/platform/aws/controller.go
  • hypershift-operator/controllers/scheduler/aws/autoscaler.go
  • hypershift-operator/controllers/scheduler/azure/controller.go
💤 Files with no reviewable changes (18)
  • control-plane-operator/controllers/gcpprivateserviceconnect/observer.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/drainer/drainer.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/machine/machine.go
  • control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go
  • hypershift-operator/controllers/nodepool/nodepool_controller.go
  • hypershift-operator/controllers/hostedcluster/hostedcluster_controller.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/node/node.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/inplaceupgrader/inplaceupgrader.go
  • hypershift-operator/controllers/scheduler/aws/autoscaler.go
  • hypershift-operator/controllers/hostedclustersizing/hostedclustersizing_validation_controller.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/registry/admissionpolicies.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/globalps/globalps.go
  • hypershift-operator/controllers/platform/aws/controller.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/nodecount/controller.go
  • hypershift-operator/controllers/scheduler/azure/controller.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/kas/admissionpolicies.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/hcpstatus/hcpstatus.go
  • control-plane-operator/hostedclusterconfigoperator/controllers/resources/resources.go

📝 Walkthrough

Walkthrough

This pull request removes informational log statements from reconciliation methods across multiple Kubernetes controllers in the control-plane-operator and hypershift-operator projects. The changes eliminate startup logs (typically log.Info("Reconciling") or similar messages) and completion logs from reconciler implementations. Additionally, some unused imports from the controller-runtime logging package are removed. No changes to reconciliation logic, control flow, error handling, or functional behavior are introduced.

🚥 Pre-merge checks | ✅ 12
✅ Passed checks (12 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: removing unconditional low-quality log messages from multiple controllers across the codebase.
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 This PR contains no Ginkgo test file changes. It only modifies 18 production controller files to remove low-quality log statements. The custom check for stable test names is not applicable.
Test Structure And Quality ✅ Passed PR contains no Ginkgo test code changes. The custom check for test structure and quality is not applicable - all changes are to controller source files removing log statements.
Microshift Test Compatibility ✅ Passed This PR only removes log statements from controller files. No new Ginkgo e2e tests are added. The MicroShift Test Compatibility check is not applicable.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR does not add any new Ginkgo e2e tests. It only removes low-quality log messages from 18 controller files. SNO test compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed PR removes unconditional log statements from 18 controllers. No scheduling constraints, affinity rules, PDBs, or topology code added/modified. Logging cleanup only, no impact on scheduling.
Ote Binary Stdout Contract ✅ Passed PR removes only low-quality log statements from controller reconcile methods using logr structured logging. No process-level code modified; no direct stdout writes found; no violations introduced.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Custom check is not applicable. This PR only modifies controller logging (removes informational log messages from 18 controllers), not Ginkgo e2e tests. Check requires new e2e tests to evaluate.

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

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

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

@csrwng csrwng marked this pull request as ready for review May 5, 2026 19:42
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 5, 2026
@openshift-ci openshift-ci Bot requested review from enxebre and muraee May 5, 2026 19:43
@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.42%. Comparing base (e09cc2d) to head (fc7aa60).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8428      +/-   ##
==========================================
+ Coverage   37.39%   37.42%   +0.02%     
==========================================
  Files         751      751              
  Lines       91806    91806              
==========================================
+ Hits        34333    34356      +23     
+ Misses      54838    54813      -25     
- Partials     2635     2637       +2     
Files with missing lines Coverage Δ
...ollers/awsprivatelink/awsprivatelink_controller.go 18.78% <ø> (-0.17%) ⬇️
...r/controllers/gcpprivateserviceconnect/observer.go 61.36% <ø> (-1.68%) ⬇️
...usterconfigoperator/controllers/drainer/drainer.go 0.00% <ø> (ø)
...terconfigoperator/controllers/globalps/globalps.go 86.64% <ø> (+0.42%) ⬆️
...rconfigoperator/controllers/hcpstatus/hcpstatus.go 0.00% <ø> (ø)
...tor/controllers/inplaceupgrader/inplaceupgrader.go 57.16% <ø> (+0.10%) ⬆️
...usterconfigoperator/controllers/machine/machine.go 67.00% <ø> (-0.17%) ⬇️
...stedclusterconfigoperator/controllers/node/node.go 38.70% <ø> (+0.41%) ⬆️
...configoperator/controllers/nodecount/controller.go 0.00% <ø> (ø)
...tor/controllers/resources/kas/admissionpolicies.go 9.25% <ø> (+0.16%) ⬆️
... and 8 more

... and 1 file with indirect coverage changes

Flag Coverage Δ
cmd-support 32.56% <ø> (ø)
cpo-hostedcontrolplane 36.48% <ø> (ø)
cpo-other 37.70% <ø> (-0.04%) ⬇️
hypershift-operator 47.95% <ø> (+0.09%) ⬆️
other 27.77% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 5, 2026

@csrwng: 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

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/platform/azure PR/issue for Azure (AzurePlatform) platform area/platform/gcp PR/issue for GCP (GCPPlatform) platform 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.

3 participants