Merge pull request #3059 from krzysied/vpa_container_state_merge_fix

VPA - Fixing container state merge
This commit is contained in:
Kubernetes Prow Robot 2020-04-17 04:31:07 -07:00 committed by GitHub
commit 6f5e8ce287
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -158,7 +158,8 @@ func (a *AggregateContainerState) MergeContainerState(other *AggregateContainerS
a.AggregateCPUUsage.Merge(other.AggregateCPUUsage) a.AggregateCPUUsage.Merge(other.AggregateCPUUsage)
a.AggregateMemoryPeaks.Merge(other.AggregateMemoryPeaks) a.AggregateMemoryPeaks.Merge(other.AggregateMemoryPeaks)
if !other.FirstSampleStart.IsZero() && other.FirstSampleStart.Before(a.FirstSampleStart) { if a.FirstSampleStart.IsZero() ||
(!other.FirstSampleStart.IsZero() && other.FirstSampleStart.Before(a.FirstSampleStart)) {
a.FirstSampleStart = other.FirstSampleStart a.FirstSampleStart = other.FirstSampleStart
} }
if other.LastSampleStart.After(a.LastSampleStart) { if other.LastSampleStart.After(a.LastSampleStart) {