mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #30325 from ronnielai/test1
Automatic merge from submit-queue Fixing a potential container deletion GC timing issue If pod manager is updated before all containers in a pod are deleted, the container clean up logic should still be triggered. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.kubernetes.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.kubernetes.io/reviews/kubernetes/kubernetes/30325) <!-- Reviewable:end -->
This commit is contained in:
commit
a9af8a56b4
@ -2205,14 +2205,13 @@ func (kl *Kubelet) syncLoopIteration(configCh <-chan kubetypes.PodUpdate, handle
|
|||||||
case e := <-plegCh:
|
case e := <-plegCh:
|
||||||
if isSyncPodWorthy(e) {
|
if isSyncPodWorthy(e) {
|
||||||
// PLEG event for a pod; sync it.
|
// PLEG event for a pod; sync it.
|
||||||
pod, ok := kl.podManager.GetPodByUID(e.ID)
|
if pod, ok := kl.podManager.GetPodByUID(e.ID); ok {
|
||||||
if !ok {
|
glog.V(2).Infof("SyncLoop (PLEG): %q, event: %#v", format.Pod(pod), e)
|
||||||
|
handler.HandlePodSyncs([]*api.Pod{pod})
|
||||||
|
} else {
|
||||||
// If the pod no longer exists, ignore the event.
|
// If the pod no longer exists, ignore the event.
|
||||||
glog.V(4).Infof("SyncLoop (PLEG): ignore irrelevant event: %#v", e)
|
glog.V(4).Infof("SyncLoop (PLEG): ignore irrelevant event: %#v", e)
|
||||||
break
|
|
||||||
}
|
}
|
||||||
glog.V(2).Infof("SyncLoop (PLEG): %q, event: %#v", format.Pod(pod), e)
|
|
||||||
handler.HandlePodSyncs([]*api.Pod{pod})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if e.Type == pleg.ContainerDied {
|
if e.Type == pleg.ContainerDied {
|
||||||
|
Loading…
Reference in New Issue
Block a user