Skip to content

Commit 069a106

Browse files
author
Joshua Reed
committed
Some cleanup.
1 parent f4f31b3 commit 069a106

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

controllers/cloudstackmachine_controller.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ func (r *CloudStackMachineReconciler) reconcile(
185185
}
186186

187187
// Create VM (or Fetch if present).
188-
if value, found := secret.Data["value"]; found {
189-
if err := r.CS.GetOrCreateVMInstance(csMachine, capiMachine, csCluster, string(value)); err == nil {
188+
if data, isPresent := secret.Data["value"]; isPresent {
189+
if err := r.CS.GetOrCreateVMInstance(csMachine, capiMachine, csCluster, string(data)); err == nil {
190190
if !controllerutil.ContainsFinalizer(csMachine, infrav1.MachineFinalizer) { // Fetched or Created?
191191
log.Info("CloudStack instance Created", "instanceStatus", csMachine.Status)
192192
controllerutil.AddFinalizer(csMachine, infrav1.MachineFinalizer)
@@ -195,11 +195,10 @@ func (r *CloudStackMachineReconciler) reconcile(
195195
return ctrl.Result{}, err
196196
}
197197
} else {
198-
return ctrl.Result{}, errors.New("bootstrap secret data not ok")
198+
return ctrl.Result{}, errors.New("bootstrap secret data not yet set")
199199
}
200200

201201
// Check status of machine.
202-
csMachine.Status.Ready = false
203202
if csMachine.Status.InstanceState == "Running" {
204203
log.Info("Machine instance is Running...")
205204
csMachine.Status.Ready = true

0 commit comments

Comments
 (0)