Skip to content

Commit

Permalink
update comments for grammar error
Browse files Browse the repository at this point in the history
  • Loading branch information
wanyufe committed Dec 9, 2022
1 parent 923483e commit 034dc37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/cloudstackmachine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ func (r *CloudStackMachineReconciliationRunner) GetOrCreateVMInstance() (retRes
r.Recorder.Eventf(r.ReconciliationSubject, "Warning", "Creating", CSMachineCreationFailed, err.Error())
}
if err == nil && !controllerutil.ContainsFinalizer(r.ReconciliationSubject, infrav1.MachineFinalizer) { // Fetched or Created?
// adding a finalizer will require CPAC reconcile-delete trying to destroy associated VM through instanceID,
// so if err is not nil, which means it could not get associated VM through instanceID or name, we should not add finalizer to CloudStackMachine,
// otherwise, reconciler-delete will be stuck trying to wait instanceID to ba available.
// Adding a finalizer will make reconcile-delete try to destroy the associated VM through instanceID.
// If err is not nil, it means CAPC could not get an associated VM through instanceID or name, so we should not add a finalizer to this CloudStackMachine,
// Otherwise, reconcile-delete will be stuck trying to wait for instanceID to be available.
controllerutil.AddFinalizer(r.ReconciliationSubject, infrav1.MachineFinalizer)
r.Recorder.Eventf(r.ReconciliationSubject, "Normal", "Created", CSMachineCreationSuccess)
r.Log.Info(CSMachineCreationSuccess, "instanceStatus", r.ReconciliationSubject.Status)
Expand Down

0 comments on commit 034dc37

Please sign in to comment.