Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
haijianyang committed Aug 4, 2023
1 parent 9cd49cb commit a18cc54
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions controllers/elfmachine_controller_placement_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ func (r *ElfMachineReconciler) joinPlacementGroup(ctx *context.MachineContext, v
return true, nil
}

// The new CP ElfMachine should wait for other new CP ElfMachines to join the target PlacementGroup.
// The powered on CP ElfMachine which is not in the PlacementGroup should wait for other new CP ElfMachines to join the target PlacementGroup.
// The code below double checks the recommended target host for migration is valid.
cpElfMachines, err := machineutil.GetControlPlaneElfMachinesInCluster(ctx, ctx.Client, ctx.Cluster.Namespace, ctx.Cluster.Name)
if err != nil {
Expand All @@ -485,7 +485,7 @@ func (r *ElfMachineReconciler) joinPlacementGroup(ctx *context.MachineContext, v
// and kcp.Status.UnavailableReplicas == 0.
// So we need to check if the number of CP ElfMachine is equal to kcp.Spec.Replicas.
if len(cpElfMachines) != int(*kcp.Spec.Replicas) {
ctx.Logger.Info("The number of CP ElfMachine does not match the expected", "kcp", formatKCP(kcp), "cpElfMachines", cpElfMachineNames)
ctx.Logger.V(1).Info("The number of CP ElfMachine does not match the expected", "kcp", formatKCP(kcp), "cpElfMachines", cpElfMachineNames)
return true, nil
}

Expand All @@ -506,7 +506,7 @@ func (r *ElfMachineReconciler) joinPlacementGroup(ctx *context.MachineContext, v
// This is the last CP ElfMachine (i.e. the 1st new CP ElfMachine) which has not been added into the target PlacementGroup.
// Migrate this VM to the target host, then it will be added into the target PlacementGroup.

ctx.Logger.V(1).Info("Start migrateVM since KCP is not in rolling update process", "targetHost", formatHost(targetHost))
ctx.Logger.V(1).Info("Start migrating VM since KCP is not in rolling update process", "targetHost", formatHost(targetHost))

return r.migrateVM(ctx, vm, *targetHost.ID)
}
Expand Down
2 changes: 1 addition & 1 deletion controllers/elfmachine_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ var _ = Describe("ElfMachineReconciler", func() {
Expect(ok).To(BeFalse())
Expect(err).To(BeZero())
Expect(elfMachine.Status.TaskRef).To(Equal(*task.ID))
Expect(logBuffer.String()).To(ContainSubstring("Start migrateVM since KCP is not in rolling update process"))
Expect(logBuffer.String()).To(ContainSubstring("Start migrating VM since KCP is not in rolling update process"))
Expect(logBuffer.String()).To(ContainSubstring("Waiting for the VM to be migrated from"))
expectConditions(elfMachine, []conditionAssertion{{infrav1.VMProvisionedCondition, corev1.ConditionFalse, clusterv1.ConditionSeverityInfo, infrav1.JoiningPlacementGroupReason}})

Expand Down

0 comments on commit a18cc54

Please sign in to comment.