From 702ad7732f053b18f81aff6c06ecbeb658db3faa Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Thu, 19 Feb 2015 08:01:16 +0100 Subject: [PATCH] Applied comments --- pkg/kubelet/kubelet.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 3d34044073e..4ad103beeeb 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -1399,13 +1399,13 @@ func (kl *Kubelet) syncLoop(updates <-chan PodUpdate, handler SyncHandler) { } // If we already caught some update, try to wait for some short time // to possibly batch it with other incoming updates. - for ; unsyncedPod; { + for unsyncedPod { select { - case u := <-updates: - kl.updatePods(u) - case <-time.After(5 * time.Millisecond): - // Break the for loop. - unsyncedPod = false + case u := <-updates: + kl.updatePods(u) + case <-time.After(5 * time.Millisecond): + // Break the for loop. + unsyncedPod = false } } @@ -1418,16 +1418,16 @@ func (kl *Kubelet) syncLoop(updates <-chan PodUpdate, handler SyncHandler) { func (kl *Kubelet) updatePods(u PodUpdate) { switch u.Op { - case SET: - glog.V(3).Infof("SET: Containers changed") - kl.pods = u.Pods - kl.pods = filterHostPortConflicts(kl.pods) - case UPDATE: - glog.V(3).Infof("Update: Containers changed") - kl.pods = updateBoundPods(u.Pods, kl.pods) - kl.pods = filterHostPortConflicts(kl.pods) - default: - panic("syncLoop does not support incremental changes") + case SET: + glog.V(3).Infof("SET: Containers changed") + kl.pods = u.Pods + kl.pods = filterHostPortConflicts(kl.pods) + case UPDATE: + glog.V(3).Infof("Update: Containers changed") + kl.pods = updateBoundPods(u.Pods, kl.pods) + kl.pods = filterHostPortConflicts(kl.pods) + default: + panic("syncLoop does not support incremental changes") } }