Merge pull request #98742 from gjkim42/sync-until-terminate-containers

kubelet: Sync completed pods until their containers have been terminated
This commit is contained in:
Kubernetes Prow Robot
2021-02-24 15:29:26 -08:00
committed by GitHub
2 changed files with 130 additions and 2 deletions

View File

@@ -2019,8 +2019,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
}