-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
k8s.io/kms: drop direct dependency on klog #120947
Conversation
635aeec
to
a2316e3
Compare
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
LGTM label has been added. Git tree hash: f881f8443265e26c1ce9c5578278b1c335cd9077
|
a2316e3
to
2de5130
Compare
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
LGTM label has been added. Git tree hash: 76dafbdf43303b1704ffbfa1227c63420b099b3b
|
/hold |
also build failure:
|
FWIW the kms staging repo is for external consumption, hence I was trying to limit its dep tree.
I figured it would fail if we didn't support go1.21 yet :) |
Using However, it means that the code doesn't support contextual logging. My proposal is that we continue to use klog for handling access to a logger and the go-logr API for log calls, i.e. not switch to slog: How important is it to remove the klog dependency? This is doable, but requires more changes than planned right now. For example, there are helpers in klog like |
For the sake of simplicity, that other package could be |
Quite high for the kms staging repo because the code in there has no use in k/k itself, it is just a thin wrapper around the proto APIs to make it easy for someone to build a plugin. The reason for using slog is so that a plugin can easily override the logger and doesn't have to deal with any of the weirdness associated with klog. I can certainly make this code just use the log package instead if we really want to. Alternatively I can delete the log statements here and move them into the mock implementation. |
Note also that this code doesn't need contextual logging because it is never going to be used in-tree. Basically this change should have no bearing on what we decide to do as a whole for the Kube project (where I agree using klog is the correct choice). |
If you want to get rid of klog, then I'd prefer to have no log calls in that package at all. That's the only short-term solution anyway, or are you ready to make Go 1.21 the required version for it? |
Who says that contextual logging is only something that is done in-tree? 😄 The concept also applies out-of-tree. For example, Cluster API is using it and the controller-runtime has support for it. |
2de5130
to
99f8240
Compare
99f8240
to
12486ab
Compare
/hold cancel I removed all usage of |
Signed-off-by: Monis Khan <mok@microsoft.com>
955be1e
to
f5cb2ad
Compare
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
LGTM label has been added. Git tree hash: 35a7cd8278402fa8e92a72fdf841aa58914e871e
|
Signed-off-by: Monis Khan mok@microsoft.com
Builds on #120896
This will make #120225 drop
klog
altogether./kind cleanup
/assign aramase