Alejandro 4 лет назад
Родитель
Сommit
533fb186db
1 измененных файлов с 1 добавлено и 4 удалено
  1. 1 4
      pkg/kubecost/allocation.go

+ 1 - 4
pkg/kubecost/allocation.go

@@ -2268,7 +2268,6 @@ func (asr *AllocationSetRange) Accumulate() (*AllocationSet, error) {
 func (asr *AllocationSetRange) AccumulateBy(resolution time.Duration) (*AllocationSetRange, error) {
 	allocSetRange := NewAllocationSetRange()
 	var allocSet *AllocationSet
-	var currAccumulatedSum time.Duration
 	var err error
 
 	asr.Lock()
@@ -2280,14 +2279,12 @@ func (asr *AllocationSetRange) AccumulateBy(resolution time.Duration) (*Allocati
 		}
 
 		if allocSet != nil {
-			currAccumulatedSum = allocSet.Window.Duration()
 
 			// check if end of asr to sum the final set
 			// If total asr accumulated sum <= resolution return 1 accumulated set
-			if currAccumulatedSum >= resolution || i == len(asr.allocations)-1 {
+			if allocSet.Window.Duration() >= resolution || i == len(asr.allocations)-1 {
 				allocSetRange.allocations = append(allocSetRange.allocations, allocSet)
 				allocSet = NewAllocationSet(time.Time{}, time.Time{})
-				currAccumulatedSum = 0
 			}
 		}
 	}