OCPBUGS-84327: Product-cli missing controller-runtime logger initialization causes noisy warning#8491
OCPBUGS-84327: Product-cli missing controller-runtime logger initialization causes noisy warning#8491amogh-redhat wants to merge 1 commit into
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
Please specify an area label DetailsInstructions 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. |
📝 WalkthroughWalkthroughThe pull request updates 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8491 +/- ##
==========================================
+ Coverage 37.55% 39.85% +2.30%
==========================================
Files 751 751
Lines 92029 92559 +530
==========================================
+ Hits 34557 36888 +2331
+ Misses 54830 52997 -1833
- Partials 2642 2674 +32
... and 47 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
product-cli's main.go lacks controller-runtime logger initialization, unlike the hypershift CLI. This generates an unnecessary warning: "log.SetLogger(...) was never called; logs will not be displayed." Add structured logging with JSON output and RFC3339 timestamps to align with the hypershift CLI. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
4ca9097 to
f2285ae
Compare
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: amogh-redhat, muraee The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@amogh-redhat: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
/retitle OCPBUGS-84327: Product-cli missing controller-runtime logger initialization causes noisy warning |
|
@amogh-redhat: This pull request references Jira Issue OCPBUGS-84327, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
/jira refresh |
|
@vsolanki12: This pull request references Jira Issue OCPBUGS-84327, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn response to this:
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. |
Test Failure Analysis CompleteJob Information
Test Failure AnalysisErrorSummaryThe Root CauseThe PR adds a ctrl.SetLogger(zap.New(zap.JSONEncoder(func(o *zapcore.EncoderConfig) {
o.EncodeTime = zapcore.RFC3339TimeEncoder
})))Codecov's patch status check measures the percentage of newly added or modified lines that are covered by tests. Because these lines live inside The repository's This is a false-positive gate failure. The code change is correct, minimal, and fixes a real user-facing issue (OCPBUGS-84327). The Recommendations
Evidence
|
What this PR does / why we need it:
product-cli/main.go does not initialize the controller-runtime logger, while the hypershift CLI (main.go) properly initializes it at line 43 with ctrl.SetLogger(zap.New(...)). This causes a noisy warning to be emitted during operations like create infra when using the product-cli:
[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
The hypershift CLI does not produce this warning because the logger is properly initialized.
Added "ctrl.SetLogger(zap.New(...))." to the product-cli/main.go to fix the above mentioned issue.
Which issue(s) this PR fixes:
Fixes : https://redhat.atlassian.net/browse/OCPBUGS-84327
Special notes for your reviewer:
Checklist:
Summary by CodeRabbit