Commit b7ec333f authored by Michael Taufen's avatar Michael Taufen

port setNodeStatusDaemonEndpoints to Setter abstraction

parent 59bb2105
...@@ -444,11 +444,6 @@ func (kl *Kubelet) recordEvent(eventType, event, message string) { ...@@ -444,11 +444,6 @@ func (kl *Kubelet) recordEvent(eventType, event, message string) {
kl.recorder.Eventf(kl.nodeRef, eventType, event, message) 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 // Set images list for the node
func (kl *Kubelet) setNodeStatusImages(node *v1.Node) { func (kl *Kubelet) setNodeStatusImages(node *v1.Node) {
// Update image list of this node // Update image list of this node
...@@ -549,7 +544,7 @@ func (kl *Kubelet) defaultNodeStatusFuncs() []func(*v1.Node) error { ...@@ -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, nodestatus.MachineInfo(string(kl.nodeName), kl.maxPods, kl.podsPerCore, kl.GetCachedMachineInfo, kl.containerManager.GetCapacity,
kl.containerManager.GetDevicePluginResourceCapacity, kl.containerManager.GetNodeAllocatableReservation, kl.recordEvent), kl.containerManager.GetDevicePluginResourceCapacity, kl.containerManager.GetNodeAllocatableReservation, kl.recordEvent),
nodestatus.VersionInfo(kl.cadvisor.VersionInfo, kl.containerRuntime.Type, kl.containerRuntime.Version), nodestatus.VersionInfo(kl.cadvisor.VersionInfo, kl.containerRuntime.Type, kl.containerRuntime.Version),
withoutError(kl.setNodeStatusDaemonEndpoints), nodestatus.DaemonEndpoints(kl.daemonEndpoints),
withoutError(kl.setNodeStatusImages), withoutError(kl.setNodeStatusImages),
withoutError(kl.setNodeStatusGoRuntime), withoutError(kl.setNodeStatusGoRuntime),
) )
......
...@@ -323,6 +323,14 @@ func VersionInfo(versionInfoFunc func() (*cadvisorapiv1.VersionInfo, error), // ...@@ -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. // ReadyCondition returns a Setter that updates the v1.NodeReady condition on the node.
func ReadyCondition( func ReadyCondition(
nowFunc func() time.Time, // typically Kubelet.clock.Now nowFunc func() time.Time, // typically Kubelet.clock.Now
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment