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

Merge branch 'develop' into nik/coverage_isempty_panic

Thomas Evans пре 2 година
родитељ
комит
fa57b7a0f9
2 измењених фајлова са 7 додато и 0 уклоњено
  1. 6 0
      pkg/kubecost/allocation.go
  2. 1 0
      pkg/kubecost/allocationprops.go

+ 6 - 0
pkg/kubecost/allocation.go

@@ -1221,6 +1221,12 @@ func (as *AllocationSet) AggregateBy(aggregateBy []string, options *AllocationAg
 	shouldShare := len(options.SharedHourlyCosts) > 0 || len(options.ShareFuncs) > 0
 	shouldShare := len(options.SharedHourlyCosts) > 0 || len(options.ShareFuncs) > 0
 	if !shouldAggregate && !shouldFilter && !shouldShare && options.ShareIdle == ShareNone && !options.IncludeProportionalAssetResourceCosts {
 	if !shouldAggregate && !shouldFilter && !shouldShare && options.ShareIdle == ShareNone && !options.IncludeProportionalAssetResourceCosts {
 		// There is nothing for AggregateBy to do, so simply return nil
 		// There is nothing for AggregateBy to do, so simply return nil
+		// before returning, set aggregated metadata inclusion in properties
+		if options.IncludeAggregatedMetadata {
+			for index := range as.Allocations {
+				as.Allocations[index].Properties.AggregatedMetadata = true
+			}
+		}
 		return nil
 		return nil
 	}
 	}
 
 

+ 1 - 0
pkg/kubecost/allocationprops.go

@@ -161,6 +161,7 @@ func (p *AllocationProperties) Clone() *AllocationProperties {
 	}
 	}
 	clone.NamespaceAnnotations = nsAnnotations
 	clone.NamespaceAnnotations = nsAnnotations
 
 
+	clone.AggregatedMetadata = p.AggregatedMetadata
 	return clone
 	return clone
 }
 }