-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
✨ Surface API Server warnings in client #1468
Conversation
Welcome @MadhavJivrajani! |
Hi @MadhavJivrajani. Thanks for your PR. I'm waiting for a kubernetes-sigs 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. |
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
- Add a wrapper around `logr.Logger` that implements WarnignHandler - Add options in client.go for settiing up behaviour of warning handler Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
/hold cancel |
pkg/client/client.go
Outdated
Deduplicate: !options.Opts.AllowDuplicateLogs, | ||
}, | ||
), | ||
) |
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 am wondering a bit if the client is the best place to plug this in. Maybe pkg/cluster would be better? Or both?
Many ppl will use the cache-backed client and all its read operations will not have this enabled since they go through the cache.
cc @vincepri
Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
} | ||
l.written[message] = struct{}{} | ||
} | ||
l.logger.Info(message) |
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.
l.logger.Info(message) | |
l.logger.Warn(message) |
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.
One clarification: if I understand correctly, the logr.Logger
interface doesn't implement a Warn
level and instead recommends specifying verbosity levels for Info
logs itself as explained here, so maybe setting a verbosity level using V
or using coloured output for the Info
messages that come out of the API Warning Logger?
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 see, lets keep it at Info then
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
/approve
Thanks for your work!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, MadhavJivrajani 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 |
Thanks so much for the constant feedback @alvaroaleman! I had a great time working on this 😄 |
* Surface API Server warnings in client - Add a wrapper around `logr.Logger` that implements WarnignHandler - Add options in client.go for settiing up behaviour of warning handler Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com> * rename logger type Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
WarningHandler
that writes tostderr
Fix #1150
/hold
/cc joelanford