diff --git a/pkg/kubelet/eviction/eviction_manager.go b/pkg/kubelet/eviction/eviction_manager.go index 2ee258b21d..d5fc2a4957 100644 --- a/pkg/kubelet/eviction/eviction_manager.go +++ b/pkg/kubelet/eviction/eviction_manager.go @@ -274,10 +274,6 @@ func (m *managerImpl) synchronize(diskInfoProvider DiskInfoProvider, podFunc Act } debugLogThresholdsWithObservation("thresholds - reclaim not satisfied", thresholds, observations) - // determine the set of thresholds whose stats have been updated since the last sync - thresholds = thresholdsUpdatedStats(thresholds, observations, m.lastObservations) - debugLogThresholdsWithObservation("thresholds - updated stats", thresholds, observations) - // track when a threshold was first observed now := m.clock.Now() thresholdsFirstObservedAt := thresholdsFirstObservedAt(thresholds, m.thresholdsFirstObservedAt, now) @@ -307,6 +303,11 @@ func (m *managerImpl) synchronize(diskInfoProvider DiskInfoProvider, podFunc Act m.thresholdsFirstObservedAt = thresholdsFirstObservedAt m.nodeConditionsLastObservedAt = nodeConditionsLastObservedAt m.thresholdsMet = thresholds + + // determine the set of thresholds whose stats have been updated since the last sync + thresholds = thresholdsUpdatedStats(thresholds, observations, m.lastObservations) + debugLogThresholdsWithObservation("thresholds - updated stats", thresholds, observations) + m.lastObservations = observations m.Unlock()