@@ -185,8 +185,8 @@ func (r *CloudStackMachineReconciler) reconcile(
185
185
}
186
186
187
187
// 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 {
190
190
if ! controllerutil .ContainsFinalizer (csMachine , infrav1 .MachineFinalizer ) { // Fetched or Created?
191
191
log .Info ("CloudStack instance Created" , "instanceStatus" , csMachine .Status )
192
192
controllerutil .AddFinalizer (csMachine , infrav1 .MachineFinalizer )
@@ -195,11 +195,10 @@ func (r *CloudStackMachineReconciler) reconcile(
195
195
return ctrl.Result {}, err
196
196
}
197
197
} else {
198
- return ctrl.Result {}, errors .New ("bootstrap secret data not ok " )
198
+ return ctrl.Result {}, errors .New ("bootstrap secret data not yet set " )
199
199
}
200
200
201
201
// Check status of machine.
202
- csMachine .Status .Ready = false
203
202
if csMachine .Status .InstanceState == "Running" {
204
203
log .Info ("Machine instance is Running..." )
205
204
csMachine .Status .Ready = true
0 commit comments