diff --git a/pkg/kubelet/kubelet_node_status.go b/pkg/kubelet/kubelet_node_status.go index 841a703b845..44093139599 100644 --- a/pkg/kubelet/kubelet_node_status.go +++ b/pkg/kubelet/kubelet_node_status.go @@ -570,7 +570,9 @@ func (kl *Kubelet) setNodeStatusMachineInfo(node *v1.Node) { devicePluginCapacity, devicePluginAllocatable, removedDevicePlugins = kl.containerManager.GetDevicePluginResourceCapacity() if devicePluginCapacity != nil { for k, v := range devicePluginCapacity { - glog.V(2).Infof("Update capacity for %s to %d", k, v.Value()) + if old, ok := node.Status.Capacity[k]; !ok || old.Value() != v.Value() { + glog.V(2).Infof("Update capacity for %s to %d", k, v.Value()) + } node.Status.Capacity[k] = v } } @@ -613,9 +615,12 @@ func (kl *Kubelet) setNodeStatusMachineInfo(node *v1.Node) { } node.Status.Allocatable[k] = value } + if devicePluginAllocatable != nil { for k, v := range devicePluginAllocatable { - glog.V(2).Infof("Update allocatable for %s to %d", k, v.Value()) + if old, ok := node.Status.Allocatable[k]; !ok || old.Value() != v.Value() { + glog.V(2).Infof("Update allocatable for %s to %d", k, v.Value()) + } node.Status.Allocatable[k] = v } }