Skip to content

Commit a809aaf

Browse files
committed
eviction: use previous statsFunc
No need to use summary to create statsFunc for localStorageEviction. Just use vals from makeSignalObservations. Signed-off-by: Wei Fu <[email protected]>
1 parent 0641e0c commit a809aaf

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/kubelet/eviction/eviction_manager.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func (m *managerImpl) synchronize(diskInfoProvider DiskInfoProvider, podFunc Act
320320
// evict pods if there is a resource usage violation from local volume temporary storage
321321
// If eviction happens in localStorageEviction function, skip the rest of eviction action
322322
if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolation) {
323-
if evictedPods := m.localStorageEviction(summary, activePods); len(evictedPods) > 0 {
323+
if evictedPods := m.localStorageEviction(activePods, statsFunc); len(evictedPods) > 0 {
324324
return evictedPods
325325
}
326326
}
@@ -450,8 +450,7 @@ func (m *managerImpl) reclaimNodeLevelResources(signalToReclaim evictionapi.Sign
450450

451451
// localStorageEviction checks the EmptyDir volume usage for each pod and determine whether it exceeds the specified limit and needs
452452
// to be evicted. It also checks every container in the pod, if the container overlay usage exceeds the limit, the pod will be evicted too.
453-
func (m *managerImpl) localStorageEviction(summary *statsapi.Summary, pods []*v1.Pod) []*v1.Pod {
454-
statsFunc := cachedStatsFunc(summary.Pods)
453+
func (m *managerImpl) localStorageEviction(pods []*v1.Pod, statsFunc statsFunc) []*v1.Pod {
455454
evicted := []*v1.Pod{}
456455
for _, pod := range pods {
457456
podStats, ok := statsFunc(pod)

0 commit comments

Comments
 (0)