Răsfoiți Sursa

Add GetWindow() to AssetSet and AllocationSet

Signed-off-by: Matt Bolt <mbolt35@gmail.com>
Matt Bolt 3 ani în urmă
părinte
comite
00ea64dba7
2 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 5 0
      pkg/kubecost/allocation.go
  2. 4 0
      pkg/kubecost/asset.go

+ 5 - 0
pkg/kubecost/allocation.go

@@ -1840,6 +1840,11 @@ func (as *AllocationSet) Resolution() time.Duration {
 	return as.Window.Duration()
 }
 
+// GetWindow returns the AllocationSet's window
+func (as *AllocationSet) GetWindow() Window {
+	return as.Window
+}
+
 // Set uses the given Allocation to overwrite the existing entry in the
 // AllocationSet under the Allocation's name.
 func (as *AllocationSet) Set(alloc *Allocation) error {

+ 4 - 0
pkg/kubecost/asset.go

@@ -2951,6 +2951,10 @@ func (as *AssetSet) Length() int {
 	return len(as.Assets)
 }
 
+func (as *AssetSet) GetWindow() Window {
+	return as.Window
+}
+
 // Resolution returns the AssetSet's window duration
 func (as *AssetSet) Resolution() time.Duration {
 	return as.Window.Duration()