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
Changed the Info type so that the config file can be displayed withou… #106228
Changed the Info type so that the config file can be displayed withou… #106228
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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/test-infra repository. I understand the commands that are listed here. |
@sanchayanghosh: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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/test-infra repository. |
Welcome @sanchayanghosh! |
Hi @sanchayanghosh. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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/test-infra repository. |
/assign @damemi |
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.
/ok-to-test
@@ -93,7 +93,7 @@ func LogOrWriteConfig(fileName string, cfg *config.KubeSchedulerConfiguration, c | |||
} | |||
|
|||
if klog.V(2).Enabled() { | |||
klog.InfoS("Using component config", "config", buf.String()) | |||
klog.Info("Using component config", "config", buf.String()) |
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.
We are intentionally trying to migrate logs to structured logging (see #105841), so I don't know if just switching this back to Info()
is the right fix. Interesting that this addresses it though, so there may be something to dig into there
@sanchayanghosh thanks for the PR, I didn't realize the changes were in such a small spot Could you paste the old-vs-current output here in code blocks so we can see what it looks like now? |
Hi @damemi I tried to paste console output from the terminal in code blocks. It just doesn't work for me. I'll try again. |
|
@sanchayanghosh for multiline code blocks use three backticks instead of 1: |
…t escape characters showing
496086f
to
2131fdb
Compare
I too wanted to localize the fixes around structured logging itself. That would require a change in klog itself to support structured logging with formatting. Do you want to create an feature request in klog? We could then link that request to #105841 |
@@ -93,7 +93,7 @@ func LogOrWriteConfig(fileName string, cfg *config.KubeSchedulerConfiguration, c | |||
} | |||
|
|||
if klog.V(2).Enabled() { | |||
klog.InfoS("Using component config", "config", buf.String()) | |||
klog.Info("Using component config", "\n-------------------------Configuration File Contents Start Here---------------------- \n", buf.String(), "\n------------------------------------Configuration File Contents End Here---------------------------------\n") |
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.
We would be giving up structured logging in this case. But I think it's better in this case.
@logicalhan WDYT?
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.
@serathius probably has a more informed opinion
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.
I think we should be able to do it using structured logging, however we might need a special formatter struct for this.
cc @pohly for recommendation
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.
A formatter doesn't help at the moment. Strings as values in a key/value pair will always be quoted in text output, that cannot be suppressed. It's worthwhile to add that, though, therefore I have filed #106262.
In the meantime this PR can and should be merged as-is.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, sanchayanghosh 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 |
/retest |
…t escape characters showing
What type of PR is this?
/kind bug
What this PR does / why we need it:
This fixes the readability of configuration log file for kube-scheduler, without escape sequences.
Which issue(s) this PR fixes:
Fixes #104868
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: