From c1faae2c3047e5da3265ee03b42fc970e507902c Mon Sep 17 00:00:00 2001 From: Prashanth Balasubramanian Date: Sun, 28 Jun 2015 19:36:27 -0700 Subject: [PATCH] Kubelet doesn't fight apiserver for cputime on the master. (cherry picked from commit 029e0ad35097c3c8fabc9812f0bc86efe699afe3) --- pkg/kubelet/status_manager.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkg/kubelet/status_manager.go b/pkg/kubelet/status_manager.go index a3501a72b19..d793b08b284 100644 --- a/pkg/kubelet/status_manager.go +++ b/pkg/kubelet/status_manager.go @@ -64,6 +64,13 @@ func isStatusEqual(oldStatus, status *api.PodStatus) bool { } func (s *statusManager) Start() { + // Don't start the status manager if we don't have a client. This will happen + // on the master, where the kubelet is responsible for bootstrapping the pods + // of the master components. + if s.kubeClient == nil { + glog.Infof("Kubernetes client is nil, not starting status manager.") + return + } // syncBatch blocks when no updates are available, we can run it in a tight loop. glog.Info("Starting to sync pod status with apiserver") go util.Forever(func() { @@ -142,10 +149,6 @@ func (s *statusManager) RemoveOrphanedStatuses(podFullNames map[string]bool) { // syncBatch syncs pods statuses with the apiserver. func (s *statusManager) syncBatch() error { - if s.kubeClient == nil { - glog.V(4).Infof("Kubernetes client is nil, skipping pod status updates") - return nil - } syncRequest := <-s.podStatusChannel pod := syncRequest.pod podFullName := kubecontainer.GetPodFullName(pod)