File tree 1 file changed +5
-1
lines changed
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()
249
249
}
250
250
251
251
func (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
+ }
252
256
r .Log .Info ("Deleting instance" , "instance-id" , r .ReconciliationSubject .Spec .InstanceID )
253
257
// Use CSClient instead of CSUser here to expunge as admin.
254
258
// 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
260
264
}
261
265
return ctrl.Result {}, err
262
266
}
263
- r .Log .Info ("VM Deleted. " )
267
+ r .Log .Info ("VM Deleted" )
264
268
controllerutil .RemoveFinalizer (r .ReconciliationSubject , infrav1 .MachineFinalizer )
265
269
return ctrl.Result {}, nil
266
270
}
You can’t perform that action at this time.
0 commit comments