mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #6595 from guenter/kubelet-update-channel-closed
kubelet syncloop should stop if/when updates chan closes
This commit is contained in:
commit
13b29cd64b
@ -1607,7 +1607,11 @@ func (kl *Kubelet) syncLoop(updates <-chan PodUpdate, handler SyncHandler) {
|
|||||||
unsyncedPod := false
|
unsyncedPod := false
|
||||||
podSyncTypes := make(map[types.UID]metrics.SyncPodType)
|
podSyncTypes := make(map[types.UID]metrics.SyncPodType)
|
||||||
select {
|
select {
|
||||||
case u := <-updates:
|
case u, ok := <-updates:
|
||||||
|
if !ok {
|
||||||
|
glog.Errorf("Update channel is closed. Exiting the sync loop.")
|
||||||
|
return
|
||||||
|
}
|
||||||
kl.podManager.UpdatePods(u, podSyncTypes)
|
kl.podManager.UpdatePods(u, podSyncTypes)
|
||||||
unsyncedPod = true
|
unsyncedPod = true
|
||||||
case <-time.After(kl.resyncInterval):
|
case <-time.After(kl.resyncInterval):
|
||||||
|
Loading…
Reference in New Issue
Block a user