mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kubelet: Fix mirrorPodTerminationMap leak
This commit is contained in:
parent
9bcb451d7d
commit
1563fb68e6
@ -1771,6 +1771,9 @@ func (kl *Kubelet) deletePod(pod *v1.Pod) error {
|
||||
}
|
||||
podPair := kubecontainer.PodPair{APIPod: pod, RunningPod: &runningPod}
|
||||
|
||||
if _, ok := kl.podManager.GetMirrorPodByPod(pod); ok {
|
||||
kl.podKiller.MarkMirrorPodPendingTermination(pod)
|
||||
}
|
||||
kl.podKiller.KillPod(&podPair)
|
||||
|
||||
// We leave the volume/directory cleanup to the periodic cleanup routine.
|
||||
@ -2109,9 +2112,6 @@ func (kl *Kubelet) HandlePodRemoves(pods []*v1.Pod) {
|
||||
kl.handleMirrorPod(pod, start)
|
||||
continue
|
||||
}
|
||||
if _, ok := kl.podManager.GetMirrorPodByPod(pod); ok {
|
||||
kl.podKiller.MarkMirrorPodPendingTermination(pod)
|
||||
}
|
||||
// Deletion is allowed to fail because the periodic cleanup routine
|
||||
// will trigger deletion again.
|
||||
if err := kl.deletePod(pod); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user