File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,10 @@ func (r *CloudStackMachineReconciliationRunner) GetOrCreateMachineStateChecker()
249249}
250250
251251func (r * CloudStackMachineReconciliationRunner ) ReconcileDelete () (retRes ctrl.Result , reterr error ) {
252+ if r .ReconciliationSubject .Spec .InstanceID == nil {
253+ r .Log .Info ("VM Instance ID is nil" )
254+ return ctrl.Result {}, nil
255+ }
252256 r .Log .Info ("Deleting instance" , "instance-id" , r .ReconciliationSubject .Spec .InstanceID )
253257 // Use CSClient instead of CSUser here to expunge as admin.
254258 // The CloudStack-Go API does not return an error, but the VM won't delete with Expunge set if requested by
@@ -260,7 +264,7 @@ func (r *CloudStackMachineReconciliationRunner) ReconcileDelete() (retRes ctrl.R
260264 }
261265 return ctrl.Result {}, err
262266 }
263- r .Log .Info ("VM Deleted. " )
267+ r .Log .Info ("VM Deleted" )
264268 controllerutil .RemoveFinalizer (r .ReconciliationSubject , infrav1 .MachineFinalizer )
265269 return ctrl.Result {}, nil
266270}
You can’t perform that action at this time.
0 commit comments