mirror of https://github.com/k3s-io/k3s
Merge pull request #20942 from Random-Liu/fix-bug-in-sync-loop
Auto commit by PR queue botpull/6/head
commit
b97214304c
|
@ -2360,8 +2360,20 @@ func (kl *Kubelet) syncLoopIteration(updates <-chan kubetypes.PodUpdate, handler
|
||||||
case update := <-kl.livenessManager.Updates():
|
case update := <-kl.livenessManager.Updates():
|
||||||
// We only care about failures (signalling container death) here.
|
// We only care about failures (signalling container death) here.
|
||||||
if update.Result == proberesults.Failure {
|
if update.Result == proberesults.Failure {
|
||||||
glog.V(1).Infof("SyncLoop (container unhealthy): %q", format.Pod(update.Pod))
|
// We should not use the pod from livenessManager, because it is never updated after
|
||||||
handler.HandlePodSyncs([]*api.Pod{update.Pod})
|
// initialization.
|
||||||
|
// TODO(random-liu): This is just a quick fix. We should:
|
||||||
|
// * Just pass pod UID in probe updates to make this less confusing.
|
||||||
|
// * Maybe probe manager should rely on pod manager, or at least the pod in probe manager
|
||||||
|
// should be updated.
|
||||||
|
pod, ok := kl.podManager.GetPodByUID(update.Pod.UID)
|
||||||
|
if !ok {
|
||||||
|
// If the pod no longer exists, ignore the update.
|
||||||
|
glog.V(4).Infof("SyncLoop (container unhealthy): ignore irrelevant update: %#v", update)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
glog.V(1).Infof("SyncLoop (container unhealthy): %q", format.Pod(pod))
|
||||||
|
handler.HandlePodSyncs([]*api.Pod{pod})
|
||||||
}
|
}
|
||||||
case <-housekeepingCh:
|
case <-housekeepingCh:
|
||||||
if !kl.allSourcesReady() {
|
if !kl.allSourcesReady() {
|
||||||
|
|
Loading…
Reference in New Issue