Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hughcapet committed Jan 3, 2025
1 parent 5cab328 commit a67621a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/cluster/majorversionupgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (c *Cluster) majorVersionUpgrade() error {
return nil
}

if !IsInMainternanceWindow(c.Spec.MaintenanceWindows) {
if !IsInMaintenanceWindow(c.Spec.MaintenanceWindows) {
c.logger.Infof("skipping major version upgrade, not in maintenance window")
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ func parseResourceRequirements(resourcesRequirement v1.ResourceRequirements) (ac
return resources, nil
}

func IsInMainternanceWindow(specMaintenanceWindows []acidv1.MaintenanceWindow) bool {
func IsInMaintenanceWindow(specMaintenanceWindows []acidv1.MaintenanceWindow) bool {
if len(specMaintenanceWindows) == 0 {
return true
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/cluster/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func (c *Controller) attemptToMoveMasterPodsOffNode(node *v1.Node) error {
for pod, cl := range masterPods {
podName := util.NameFromMeta(pod.ObjectMeta)

if !cluster.IsInMainternanceWindow(cl.Spec.MaintenanceWindows) {
if !cluster.IsInMaintenanceWindow(cl.Spec.MaintenanceWindows) {
c.logger.Infof("skipping master pod migration, not in maintenance window")
continue
}
Expand Down

0 comments on commit a67621a

Please sign in to comment.