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
Remove duplicate calculation nodename、hostname、hostnameOverridden when kubelet is initialized #90284
Remove duplicate calculation nodename、hostname、hostnameOverridden when kubelet is initialized #90284
Conversation
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.
this looks correct. suggest doing the same plumbing hostname and hostnameOverridden in instead of recomputing
cmd/kubelet/app/server.go
Outdated
kubeServer.HostnameOverride, | ||
nodeName, |
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.
kubeServer.HostnameOverride, | |
nodeName, | |
hostname, | |
len(kubeServer.HostnameOverride) > 0, | |
nodeName, |
cmd/kubelet/app/server.go
Outdated
hostnameOverride string, | ||
nodeName types.NodeName, |
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.
hostnameOverride string, | |
nodeName types.NodeName, | |
hostname string, | |
hostnameOverridden bool, | |
nodeName types.NodeName, |
cmd/kubelet/app/server.go
Outdated
hostnameOverride, | ||
nodeName, |
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.
hostnameOverride, | |
nodeName, | |
hostname, | |
hostnameOverridden, | |
nodeName, |
pkg/kubelet/kubelet.go
Outdated
hostnameOverride string, | ||
nodeName types.NodeName, |
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.
hostnameOverride string, | |
nodeName types.NodeName, | |
hostname string, | |
hostnameOverridden string, | |
nodeName types.NodeName, |
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.
Thank you very much, very good advice, so that hostname, nodename, hostnameOverridden can avoid double compute, has been completed
117b755
to
40da2c5
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: liggitt, wawa0210 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Remove the repeated calculation of nodeName and hostname during kubelet startup, these parameters are all calculated in the
RunKubelet
methodkubernetes/cmd/kubelet/app/server.go
Lines 1053 to 1062 in e951061
kubernetes/cmd/kubelet/app/server.go
Lines 947 to 965 in e951061
So the subsequent process does not need to be repeated
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/assign @vishh