Преглед изворни кода

Fix a bug recently introduced (never released) that prevented access to asset totals

Niko Kovacevic пре 4 година
родитељ
комит
eae5f1ad9c
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      pkg/kubecost/totals.go

+ 2 - 2
pkg/kubecost/totals.go

@@ -648,7 +648,7 @@ func (mts *MemoryTotalsStore) SetAllocationTotalsByNode(start time.Time, end tim
 // by cluster for the given start and end times.
 // by cluster for the given start and end times.
 func (mts *MemoryTotalsStore) GetAssetTotalsByCluster(start time.Time, end time.Time) (map[string]*AssetTotals, bool) {
 func (mts *MemoryTotalsStore) GetAssetTotalsByCluster(start time.Time, end time.Time) (map[string]*AssetTotals, bool) {
 	k := storeKey(start, end)
 	k := storeKey(start, end)
-	if raw, ok := mts.assetTotalsByCluster.Get(k); ok {
+	if raw, ok := mts.assetTotalsByCluster.Get(k); !ok {
 		return map[string]*AssetTotals{}, false
 		return map[string]*AssetTotals{}, false
 	} else {
 	} else {
 		original := raw.(map[string]*AssetTotals)
 		original := raw.(map[string]*AssetTotals)
@@ -664,7 +664,7 @@ func (mts *MemoryTotalsStore) GetAssetTotalsByCluster(start time.Time, end time.
 // by node for the given start and end times.
 // by node for the given start and end times.
 func (mts *MemoryTotalsStore) GetAssetTotalsByNode(start time.Time, end time.Time) (map[string]*AssetTotals, bool) {
 func (mts *MemoryTotalsStore) GetAssetTotalsByNode(start time.Time, end time.Time) (map[string]*AssetTotals, bool) {
 	k := storeKey(start, end)
 	k := storeKey(start, end)
-	if raw, ok := mts.assetTotalsByNode.Get(k); ok {
+	if raw, ok := mts.assetTotalsByNode.Get(k); !ok {
 		return map[string]*AssetTotals{}, false
 		return map[string]*AssetTotals{}, false
 	} else {
 	} else {
 		original := raw.(map[string]*AssetTotals)
 		original := raw.(map[string]*AssetTotals)