mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Applied comments
This commit is contained in:
parent
25c8f07c67
commit
702ad7732f
@ -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
|
// If we already caught some update, try to wait for some short time
|
||||||
// to possibly batch it with other incoming updates.
|
// to possibly batch it with other incoming updates.
|
||||||
for ; unsyncedPod; {
|
for unsyncedPod {
|
||||||
select {
|
select {
|
||||||
case u := <-updates:
|
case u := <-updates:
|
||||||
kl.updatePods(u)
|
kl.updatePods(u)
|
||||||
case <-time.After(5 * time.Millisecond):
|
case <-time.After(5 * time.Millisecond):
|
||||||
// Break the for loop.
|
// Break the for loop.
|
||||||
unsyncedPod = false
|
unsyncedPod = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1418,16 +1418,16 @@ func (kl *Kubelet) syncLoop(updates <-chan PodUpdate, handler SyncHandler) {
|
|||||||
|
|
||||||
func (kl *Kubelet) updatePods(u PodUpdate) {
|
func (kl *Kubelet) updatePods(u PodUpdate) {
|
||||||
switch u.Op {
|
switch u.Op {
|
||||||
case SET:
|
case SET:
|
||||||
glog.V(3).Infof("SET: Containers changed")
|
glog.V(3).Infof("SET: Containers changed")
|
||||||
kl.pods = u.Pods
|
kl.pods = u.Pods
|
||||||
kl.pods = filterHostPortConflicts(kl.pods)
|
kl.pods = filterHostPortConflicts(kl.pods)
|
||||||
case UPDATE:
|
case UPDATE:
|
||||||
glog.V(3).Infof("Update: Containers changed")
|
glog.V(3).Infof("Update: Containers changed")
|
||||||
kl.pods = updateBoundPods(u.Pods, kl.pods)
|
kl.pods = updateBoundPods(u.Pods, kl.pods)
|
||||||
kl.pods = filterHostPortConflicts(kl.pods)
|
kl.pods = filterHostPortConflicts(kl.pods)
|
||||||
default:
|
default:
|
||||||
panic("syncLoop does not support incremental changes")
|
panic("syncLoop does not support incremental changes")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user