Extend MaintenanceWindows parameter usage (#2810)

Consider maintenance window when migrating master pods and replacing pods (rolling update)
This commit is contained in:
Polina Bungina
2025-01-15 18:04:36 +01:00
committed by GitHub
parent 46d5ebef6d
commit 8522331cf2
11 changed files with 168 additions and 30 deletions
+3 -3
View File
@@ -650,7 +650,7 @@ func Test_trimCronjobName(t *testing.T) {
}
}
func TestIsInMaintenanceWindow(t *testing.T) {
func TestisInMaintenanceWindow(t *testing.T) {
now := time.Now()
futureTimeStart := now.Add(1 * time.Hour)
futureTimeStartFormatted := futureTimeStart.Format("15:04")
@@ -705,8 +705,8 @@ func TestIsInMaintenanceWindow(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
cluster.Spec.MaintenanceWindows = tt.windows
if isInMainternanceWindow(cluster.Spec.MaintenanceWindows) != tt.expected {
t.Errorf("Expected isInMainternanceWindow to return %t", tt.expected)
if isInMaintenanceWindow(cluster.Spec.MaintenanceWindows) != tt.expected {
t.Errorf("Expected isInMaintenanceWindow to return %t", tt.expected)
}
})
}