Browse Source

Update windows helper function to support weekly resolution

Signed-off-by: Sean Holcomb <seanholcomb@gmail.com>
Sean Holcomb 3 years ago
parent
commit
521ddb7eec
1 changed files with 1 additions and 1 deletions
  1. 1 1
      pkg/kubecost/window.go

+ 1 - 1
pkg/kubecost/window.go

@@ -796,7 +796,7 @@ func GetWindows(start time.Time, end time.Time, windowSize time.Duration) ([]Win
 	}
 
 	// Ensure that provided times are multiples of the provided windowSize (e.g. midnight for daily windows, on the hour for hourly windows)
-	if start != start.Truncate(windowSize) {
+	if start != RoundBack(start, windowSize) {
 		return nil, fmt.Errorf("provided times are not divisible by provided window: [%s, %s] by %s", start, end, windowSize)
 	}