mirror of https://github.com/k3s-io/k3s
Merge pull request #29080 from Random-Liu/continue-cleanup-despite-of-error
Automatic merge from submit-queue Make kubelet continue cleanup when there is noncritical error. Fix https://github.com/kubernetes/kubernetes/issues/29078. Even though there is error when cleaning up pod directory or bandwidth limits, kubelet could continue cleanup the following stuff. However, when runtime cache or runtime returns error, cleanup should fail, because the following cleanup relies on the `runningPod`. @yujuhong /cc @kubernetes/sig-nodepull/6/head
commit
6c1675a5cd
|
@ -2091,20 +2091,23 @@ func (kl *Kubelet) HandlePodCleanups() error {
|
|||
// deleted pods.
|
||||
err = kl.cleanupOrphanedPodDirs(allPods, runningPods)
|
||||
if err != nil {
|
||||
// We want all cleanup tasks to be run even if one of them failed. So
|
||||
// we just log an error here and continue other cleanup tasks.
|
||||
// This also applies to the other clean up tasks.
|
||||
glog.Errorf("Failed cleaning up orphaned pod directories: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
// Remove any orphaned mirror pods.
|
||||
kl.podManager.DeleteOrphanedMirrorPods()
|
||||
|
||||
// Clear out any old bandwidth rules
|
||||
if err = kl.cleanupBandwidthLimits(allPods); err != nil {
|
||||
return err
|
||||
err = kl.cleanupBandwidthLimits(allPods)
|
||||
if err != nil {
|
||||
glog.Errorf("Failed cleaning up bandwidth limits: %v", err)
|
||||
}
|
||||
|
||||
kl.backOff.GC()
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
// podKiller launches a goroutine to kill a pod received from the channel if
|
||||
|
|
Loading…
Reference in New Issue