From 61ba9171cef26763a993f7363043523943cc7a8c Mon Sep 17 00:00:00 2001 From: Darren Shepherd Date: Tue, 5 May 2020 14:51:39 -0700 Subject: [PATCH] Only echo Waiting for kubelet every 30 seconds Don't print a message every second while we are waiting for the kubelet to report Ready. --- pkg/agent/run.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/agent/run.go b/pkg/agent/run.go index ad304c5869..8bd19adbb5 100644 --- a/pkg/agent/run.go +++ b/pkg/agent/run.go @@ -159,10 +159,14 @@ func validate() error { } func configureNode(ctx context.Context, agentConfig *daemonconfig.Agent, nodes v1.NodeInterface) error { + count := 0 for { node, err := nodes.Get(ctx, agentConfig.NodeName, metav1.GetOptions{}) if err != nil { - logrus.Infof("Waiting for kubelet to be ready on node %s: %v", agentConfig.NodeName, err) + if count%30 == 0 { + logrus.Infof("Waiting for kubelet to be ready on node %s: %v", agentConfig.NodeName, err) + } + count++ time.Sleep(1 * time.Second) continue }