diff --git a/pkg/kubelet/kubelet_node_status.go b/pkg/kubelet/kubelet_node_status.go index 0f7f5df45c4..553e28ba7f4 100644 --- a/pkg/kubelet/kubelet_node_status.go +++ b/pkg/kubelet/kubelet_node_status.go @@ -444,11 +444,6 @@ func (kl *Kubelet) recordEvent(eventType, event, message string) { kl.recorder.Eventf(kl.nodeRef, eventType, event, message) } -// Set daemonEndpoints for the node. -func (kl *Kubelet) setNodeStatusDaemonEndpoints(node *v1.Node) { - node.Status.DaemonEndpoints = *kl.daemonEndpoints -} - // Set images list for the node func (kl *Kubelet) setNodeStatusImages(node *v1.Node) { // Update image list of this node @@ -549,7 +544,7 @@ func (kl *Kubelet) defaultNodeStatusFuncs() []func(*v1.Node) error { nodestatus.MachineInfo(string(kl.nodeName), kl.maxPods, kl.podsPerCore, kl.GetCachedMachineInfo, kl.containerManager.GetCapacity, kl.containerManager.GetDevicePluginResourceCapacity, kl.containerManager.GetNodeAllocatableReservation, kl.recordEvent), nodestatus.VersionInfo(kl.cadvisor.VersionInfo, kl.containerRuntime.Type, kl.containerRuntime.Version), - withoutError(kl.setNodeStatusDaemonEndpoints), + nodestatus.DaemonEndpoints(kl.daemonEndpoints), withoutError(kl.setNodeStatusImages), withoutError(kl.setNodeStatusGoRuntime), ) diff --git a/pkg/kubelet/nodestatus/setters.go b/pkg/kubelet/nodestatus/setters.go index 66f161a2902..1e0a21200b6 100644 --- a/pkg/kubelet/nodestatus/setters.go +++ b/pkg/kubelet/nodestatus/setters.go @@ -323,6 +323,14 @@ func VersionInfo(versionInfoFunc func() (*cadvisorapiv1.VersionInfo, error), // } } +// DaemonEndpoints returns a Setter that updates the daemon endpoints on the node. +func DaemonEndpoints(daemonEndpoints *v1.NodeDaemonEndpoints) Setter { + return func(node *v1.Node) error { + node.Status.DaemonEndpoints = *daemonEndpoints + return nil + } +} + // ReadyCondition returns a Setter that updates the v1.NodeReady condition on the node. func ReadyCondition( nowFunc func() time.Time, // typically Kubelet.clock.Now