kubelet: Sync completed pods until their containers have been terminated

This commit is contained in:
Geonju Kim
2021-02-04 10:17:42 +09:00
committed by Geonju Kim
parent 26744ac58d
commit 321ca8af52
2 changed files with 130 additions and 2 deletions

View File

@@ -2020,8 +2020,9 @@ func (kl *Kubelet) dispatchWork(pod *v1.Pod, syncType kubetypes.SyncPodType, mir
}
// optimization: avoid invoking the pod worker if no further changes are possible to the pod definition
if podWorkerTerminal {
klog.V(4).Infof("Pod %q has completed, ignoring remaining sync work: %s", format.Pod(pod), syncType)
// (i.e. the pod has completed and its containers have been terminated)
if podWorkerTerminal && containersTerminal {
klog.V(4).InfoS("Pod has completed and its containers have been terminated, ignoring remaining sync work", "pod", klog.KObj(pod), "syncType", syncType)
return
}