NO-JIRA: controller/servingcerts: Align log verbosity#323
NO-JIRA: controller/servingcerts: Align log verbosity#323tchap wants to merge 1 commit intoopenshift:mainfrom
Conversation
Some informational statements are being logged on V(4), which makes then effectively invisible in production clusters. It would be handly to have them for analyzing cluster issues, though.
|
@tchap: This pull request explicitly references no jira issue. 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. |
WalkthroughLog verbosity levels reduced from V(4) to V(2) across multiple informational messages in the serving certificate controller's secret creation logic. No functional changes to control flow or error handling. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tchap The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/controller/servingcert/controller/secret_creating_controller.go (1)
242-248: Consider usingklog.Warningffor warning messages.The verbosity adjustment is appropriate. However, these messages are semantically warnings (they indicate parsing errors that trigger cert regeneration). Consider using
klog.Warningf()instead ofklog.V(2).Infof("warning: ...")for clearer log semantics and consistent filtering.♻️ Optional: Use warning-level logging
certs, err := cert.ParseCertsPEM(secret.Data[corev1.TLSCertKey]) if err != nil { - klog.V(2).Infof("warning: error parsing certificate data in %s/%s during regeneration check: %v", + klog.Warningf("error parsing certificate data in %s/%s during regeneration check: %v", secret.Namespace, secret.Name, err) return true } if len(certs) == 0 || certs[0] == nil { - klog.V(2).Infof("warning: no certs returned from ParseCertsPEM during regeneration check") + klog.Warningf("no certs returned from ParseCertsPEM during regeneration check") return true }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/controller/servingcert/controller/secret_creating_controller.go` around lines 242 - 248, The two log lines in secret_creating_controller.go that currently call klog.V(2).Infof with a "warning: ..." message should be changed to use klog.Warningf to reflect true warning semantics; specifically replace the klog.V(2).Infof call that logs the parsing error for secret.Namespace/secret.Name (in the ParseCertsPEM regeneration-check path) and the klog.V(2).Infof call that logs "no certs returned from ParseCertsPEM during regeneration check" with klog.Warningf calls that keep the same message and parameters so the warning level is used consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/controller/servingcert/controller/secret_creating_controller.go`:
- Around line 242-248: The two log lines in secret_creating_controller.go that
currently call klog.V(2).Infof with a "warning: ..." message should be changed
to use klog.Warningf to reflect true warning semantics; specifically replace the
klog.V(2).Infof call that logs the parsing error for
secret.Namespace/secret.Name (in the ParseCertsPEM regeneration-check path) and
the klog.V(2).Infof call that logs "no certs returned from ParseCertsPEM during
regeneration check" with klog.Warningf calls that keep the same message and
parameters so the warning level is used consistently.
ℹ️ Review info
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
pkg/controller/servingcert/controller/secret_creating_controller.go
|
CI blocked by openshift/oc#2215 |
3 similar comments
|
/retest |
|
@tchap: The following test failed, say
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. |
Some informational statements are being logged on V(4), which makes then effectively invisible in production clusters. It would be handly to have them for analyzing cluster issues, though.
Summary by CodeRabbit