瀏覽代碼

Fix bug in retrieving allocation totals by node

Niko Kovacevic 4 年之前
父節點
當前提交
288b0f9328
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pkg/kubecost/totals.go

+ 1 - 1
pkg/kubecost/totals.go

@@ -618,7 +618,7 @@ func (mts *MemoryTotalsStore) GetAllocationTotalsByCluster(start time.Time, end
 // by node for the given start and end times.
 // by node for the given start and end times.
 func (mts *MemoryTotalsStore) GetAllocationTotalsByNode(start time.Time, end time.Time) (map[string]*AllocationTotals, bool) {
 func (mts *MemoryTotalsStore) GetAllocationTotalsByNode(start time.Time, end time.Time) (map[string]*AllocationTotals, bool) {
 	k := storeKey(start, end)
 	k := storeKey(start, end)
-	if raw, ok := mts.allocTotalsByNode.Get(k); ok {
+	if raw, ok := mts.allocTotalsByNode.Get(k); !ok {
 		return map[string]*AllocationTotals{}, false
 		return map[string]*AllocationTotals{}, false
 	} else {
 	} else {
 		original := raw.(map[string]*AllocationTotals)
 		original := raw.(map[string]*AllocationTotals)