ソースを参照

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

Update Window Helper Function for Week Resolution Support
Sean Holcomb 3 年 前
コミット
d121d54be4
1 ファイル変更1 行追加1 行削除
  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)
 	// 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)
 		return nil, fmt.Errorf("provided times are not divisible by provided window: [%s, %s] by %s", start, end, windowSize)
 	}
 	}