mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-03 02:07:38 +00:00
Merge pull request #78368 from tedyu/evict-sandboxes
Call getKubeletSandboxes first in containerGC#evictSandboxes
This commit is contained in:
@@ -277,17 +277,17 @@ func (cgc *containerGC) evictSandboxes(evictTerminatedPods bool) error {
|
||||
return err
|
||||
}
|
||||
|
||||
sandboxes, err := cgc.manager.getKubeletSandboxes(true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// collect all the PodSandboxId of container
|
||||
sandboxIDs := sets.NewString()
|
||||
for _, container := range containers {
|
||||
sandboxIDs.Insert(container.PodSandboxId)
|
||||
}
|
||||
|
||||
sandboxes, err := cgc.manager.getKubeletSandboxes(true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
sandboxesByPod := make(sandboxesByPodUID)
|
||||
for _, sandbox := range sandboxes {
|
||||
podUID := types.UID(sandbox.Metadata.Uid)
|
||||
|
Reference in New Issue
Block a user