-
Notifications
You must be signed in to change notification settings - Fork 40.9k
feat(kubelet): migrate kuberuntime to contextual logging #132427
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
base: master
Are you sure you want to change the base?
feat(kubelet): migrate kuberuntime to contextual logging #132427
Conversation
Hi @soma00333. 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-sigs/prow repository. |
97ba55e
to
f043d19
Compare
1e1f5d0
to
89b884d
Compare
/triage accepted |
d7c88c4
to
54cfb79
Compare
@soma00333 CI failure is fixed in master, please rebase. |
24facf1
to
350116a
Compare
/retest |
ca08fb3
to
35a3e87
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: soma00333 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
35a3e87
to
e67fad3
Compare
/retest |
1 similar comment
/retest |
A couple of small nits, otherwise lgtm. |
a4567eb
to
8a9dbc1
Compare
/lgtm @soma00333 As your PR is quite big, I'd suggest to ask approvers on Slack or even on SIG-Node meeting to look at it. Otherwise it's going to be conflicting with other changes and you'll end up rebasing it again and again. /assign @mrunalp @SergeyKanzhelev @dchen1107 |
LGTM label has been added. Git tree hash: b1d7d3874ec8024f27428ca5cf9a8002a29fb166
|
@bart0sh Thank you very much for your thoughtful review and valuable suggestions. I will. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR migrates the
pkg/kubelet/kuberuntime
package to use contextual logging as part of the ongoing effort to improve structured logging in Kubernetes.The main changes include:
klog
calls with contextual logging usinglogger
fromklog.FromContext(ctx)
ktesting.Init(t)
for consistent logger initializationNotable refactoring:
sync.OnceValue
variable to a field inkubeGenericRuntimeManager
to eliminatecontext.TODO()
usage. The implementation maintains lazy initialization usingsync.OnceValue
and ensures consistent design pattern throughout the codebase:getSwapControllerAvailable func() bool
field tokubeGenericRuntimeManager
swapConfigurationHelper
to acceptgetSwapControllerAvailable func() bool
instead of eagerly evaluating the boolean valuekubeGenericRuntimeManager
andswapConfigurationHelper
Please check the following documents
Which issue(s) this PR is related to:
Part of #130069
Special notes for your reviewer:
There are still 2
context.TODO()
remaining in the package:These cannot be addressed in this PR because they are called from outside the kuberuntime package.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: