mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Make kubelet continue cleanup when there is noncritical error.
This commit is contained in:
parent
0bec77bd6b
commit
62d2979e1b
@ -2074,20 +2074,23 @@ func (kl *Kubelet) HandlePodCleanups() error {
|
|||||||
// deleted pods.
|
// deleted pods.
|
||||||
err = kl.cleanupOrphanedPodDirs(allPods, runningPods)
|
err = kl.cleanupOrphanedPodDirs(allPods, runningPods)
|
||||||
if err != nil {
|
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)
|
glog.Errorf("Failed cleaning up orphaned pod directories: %v", err)
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove any orphaned mirror pods.
|
// Remove any orphaned mirror pods.
|
||||||
kl.podManager.DeleteOrphanedMirrorPods()
|
kl.podManager.DeleteOrphanedMirrorPods()
|
||||||
|
|
||||||
// Clear out any old bandwidth rules
|
// Clear out any old bandwidth rules
|
||||||
if err = kl.cleanupBandwidthLimits(allPods); err != nil {
|
err = kl.cleanupBandwidthLimits(allPods)
|
||||||
return err
|
if err != nil {
|
||||||
|
glog.Errorf("Failed cleaning up bandwidth limits: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
kl.backOff.GC()
|
kl.backOff.GC()
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// podKiller launches a goroutine to kill a pod received from the channel if
|
// podKiller launches a goroutine to kill a pod received from the channel if
|
||||||
|
Loading…
Reference in New Issue
Block a user