mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
port setNodeStatusDaemonEndpoints to Setter abstraction
This commit is contained in:
parent
59bb21051e
commit
b7ec333f01
@ -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),
|
||||
)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user