Merge pull request #3089 from krzysied/vpa_oom_cp_07

VPA - Always processing OOM samples
This commit is contained in:
Kubernetes Prow Robot 2020-04-24 03:58:07 -07:00 committed by GitHub
commit 392f2f4f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -134,7 +134,9 @@ func (container *ContainerState) GetMaxMemoryPeak() ResourceAmount {
func (container *ContainerState) addMemorySample(sample *ContainerUsageSample, isOOM bool) bool {
ts := sample.MeasureStart
if !sample.isValid(ResourceMemory) || ts.Before(container.lastMemorySampleStart) {
// We always process OOM samples.
if !sample.isValid(ResourceMemory) ||
(!isOOM && ts.Before(container.lastMemorySampleStart)) {
return false // Discard invalid or outdated samples.
}
container.lastMemorySampleStart = ts