@@ -159,6 +159,14 @@ func (r *MachineReconciler) reconcileExternal(ctx context.Context, cluster *clus
159
159
160
160
// reconcileBootstrap reconciles the Spec.Bootstrap.ConfigRef object on a Machine.
161
161
func (r * MachineReconciler ) reconcileBootstrap (ctx context.Context , cluster * clusterv1.Cluster , m * clusterv1.Machine ) error {
162
+ // If the bootstrap data is populated, set ready and return.
163
+ if m .Spec .Bootstrap .DataSecretName != nil {
164
+ m .Status .BootstrapReady = true
165
+ conditions .MarkTrue (m , clusterv1 .BootstrapReadyCondition )
166
+ return nil
167
+ }
168
+
169
+ // If the Boostrap ref is nil (and so the machine should use user generated data secret), return.
162
170
if m .Spec .Bootstrap .ConfigRef == nil {
163
171
return nil
164
172
}
@@ -190,13 +198,6 @@ func (r *MachineReconciler) reconcileBootstrap(ctx context.Context, cluster *clu
190
198
conditions .WithFallbackValue (ready , clusterv1 .WaitingForDataSecretFallbackReason , clusterv1 .ConditionSeverityInfo , "" ),
191
199
)
192
200
193
- // If the bootstrap data is populated, set ready and return.
194
- if m .Spec .Bootstrap .DataSecretName != nil {
195
- m .Status .BootstrapReady = true
196
- conditions .MarkTrue (m , clusterv1 .BootstrapReadyCondition )
197
- return nil
198
- }
199
-
200
201
// If the bootstrap provider is not ready, requeue.
201
202
if ! ready {
202
203
return errors .Wrapf (& capierrors.RequeueAfterError {RequeueAfter : externalReadyWait },
0 commit comments