From 7297dd33bb693aea29b5bc8ded0b3de3ddd368bb Mon Sep 17 00:00:00 2001 From: Renaud Gaubert Date: Wed, 18 Apr 2018 13:16:26 +0200 Subject: [PATCH] Change Capacity log verbosity in node status update --- pkg/kubelet/kubelet_node_status.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/kubelet/kubelet_node_status.go b/pkg/kubelet/kubelet_node_status.go index f622f33adff..e474757e068 100644 --- a/pkg/kubelet/kubelet_node_status.go +++ b/pkg/kubelet/kubelet_node_status.go @@ -592,7 +592,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 } } @@ -635,9 +637,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 } }