We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbfe201 commit 9c16535Copy full SHA for 9c16535
pkg/cluster/util.go
@@ -759,3 +759,24 @@ func (c *Cluster) multisiteEnabled() bool {
759
}
760
return enable != nil && *enable
761
762
+
763
+func isInMaintenanceWindow(specMaintenanceWindows []cpov1.MaintenanceWindow) bool {
764
+ if len(specMaintenanceWindows) == 0 {
765
+ return true
766
+ }
767
+ now := time.Now()
768
+ currentDay := now.Weekday()
769
+ currentTime := now.Format("15:04")
770
771
+ for _, window := range specMaintenanceWindows {
772
+ startTime := window.StartTime.Format("15:04")
773
+ endTime := window.EndTime.Format("15:04")
774
775
+ if window.Everyday || window.Weekday == currentDay {
776
+ if currentTime >= startTime && currentTime <= endTime {
777
778
779
780
781
+ return false
782
+}
0 commit comments