-
Notifications
You must be signed in to change notification settings - Fork 40.9k
Migrate devicemanager to context logging (1/5) #132540
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?
Conversation
|
Welcome @chuangw6! |
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-sigs/prow repository. |
Hi @chuangw6. 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. |
/ok-to-test |
2986644
to
36d6bfa
Compare
/retest |
4eea21f
to
b32e789
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: chuangw6 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 |
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.
thanks for the PR! I'm generally very supportive of moving to contextual logging (and my own effort starved). I expect a somehow long tail of tuning and refinements after the initial plumbing lands, but by all means let's get the plumbing merged before!
Some comments inside
Connect(ctx context.Context) error | ||
Run(ctx context.Context) | ||
Disconnect(ctx context.Context) error |
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.
not sure we can just the method signature of the interface, will check
func (h *RegistrationHandler) ValidatePlugin(pluginName string, endpoint string, versions []string) error { | ||
klog.Info(log("Trying to validate a new CSI Driver with name: %s endpoint: %s versions: %s", | ||
pluginName, endpoint, strings.Join(versions, ","))) | ||
func (h *RegistrationHandler) ValidatePlugin(ctx context.Context, pluginName string, endpoint string, versions []string) error { |
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.
likewise, are updating all plugins in one go or just device manager?
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.
My goal was to just update device manager, but to migrate pkg/kubelet/cm/devicemanager/plugin/v1beta1/handler.go, the PluginHandler
interface in pkg/kubelet/pluginmanager/cache/types.go needs to be updated. Otherwise, type check will fail. This led to a series of cascading changes.
nolint:errcheck |
/test pull-kubernetes-linter-hints |
/test pull-kubernetes-node-e2e-containerd |
@chuangw6: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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. |
General note about migration to contextual logging. There are quite few areas where we can use or should use more contexts; that's fine. In general however just passing context around for the sake of using the logger instance (because this is only the legit use of the context in such cases) seems suboptimal. |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
migrate pkg/kubelet/cm/devicemanager to contextual logging
Which issue(s) this PR is related to:
#130069
Special notes for your reviewer:
This PR migrated:
NewManagerImpl
,Start
andStop
in pkg/kubelet/cm/devicemanager/manager.goSorry for this PR's size. I fall down the rabbit hole of plumbing through context :<. I will migrate following files with smaller PRs:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: