Explorar o código

Merge pull request #1835 from opencost/sean/update-helper-for-week-support

Update Window Helper Function for Week Resolution Support
Sean Holcomb %!s(int64=3) %!d(string=hai) anos
pai
achega
d121d54be4
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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)
 	}