-
Notifications
You must be signed in to change notification settings - Fork 461
MCO-408: Add OpenShift-native access to change logLevel for MachineConfigOperator components #5291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@djoshy: This pull request references MCO-408 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 "4.21.0" version, but no target version was set. In 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. |
|
Skipping CI for Draft Pull Request. |
|
/test all |
a80b23f to
c2a2784
Compare
|
/test verify-deps |
|
@djoshy: This pull request references MCO-408 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 "4.21.0" version, but no target version was set. In 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. |
|
@djoshy: This pull request references MCO-408 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 "4.21.0" version, but no target version was set. In 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. |
|
@djoshy: The following tests failed, say
Full PR test history. Your PR dashboard. 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. |
|
/retest-required |
isabella-janssen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Changes look fair to me!
dkhater-redhat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me. thanks for this!
pablintino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
Agree with the change.
| } | ||
|
|
||
| func getRenderConfig(tnamespace, kubeAPIServerServingCA string, ccSpec *mcfgv1.ControllerConfigSpec, imgs *ctrlcommon.RenderConfigImages, infra *configv1.Infrastructure, pointerConfigData []byte, apiServer *configv1.APIServer) *renderConfig { | ||
| func getRenderConfig(tnamespace, kubeAPIServerServingCA string, ccSpec *mcfgv1.ControllerConfigSpec, imgs *ctrlcommon.RenderConfigImages, infra *configv1.Infrastructure, pointerConfigData []byte, apiServer *configv1.APIServer, logLevel string) *renderConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This function starts to ask for applying the builder pattern to construct renderConfig. 8 args in a function is a reasonable limit, but I'd not advocate allowing many more.
(just my 2cents, no action in your change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally fair 👍
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: djoshy, dkhater-redhat, isabella-janssen, pablintino The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Pre-merge verified:
Only question I have here is if I patched the empty string value in machineconfiguration the log level value is moved to 2 that is default but in machineconfiguration Normal is not patched back. Is this expected? Other than looks good to me |
This is expected, it looks like the helper defaults to 2 for unknown values(an empty string would be that case). I'm surprised an empty string is even allowed, the API seems to default to normal? |
|
I see this is expected then, thankyou for clearing the doubt! |
|
/qe-approved |
|
/verified by @ptalgulk01 |
|
@ptalgulk01: This PR has been marked as verified by In 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. |
adb087c
into
openshift:main
- What I did
This PR dynamically updates the MCO operands' log levels in response to changes of the operatorLogLevel field in the
MachineConfigurationobject. I leveraged the loglevel helpers provided by library-go to dynamically change the operator pod's verbosity level and for the remaining operands, I added a new template variable which is rendered out to the daemon, server and controller manifests.- How to verify it
spec.operatorLogLevelfield defaults toNormal. Other possible values areDebug,TraceandTraceAll. Set it to any other value, and observe the operator logs. It should note the log level change like so:Each of these manifests should have a verbosity level that is matching the one you'd set in the
MachineConfigurationobject. It is set toDebugin the above example, which corresponds to 4.