@@ -175,13 +175,6 @@ func (r *Reconciler) reconcileExternal(ctx context.Context, cluster *clusterv1.C
175
175
func (r * Reconciler ) reconcileBootstrap (ctx context.Context , cluster * clusterv1.Cluster , m * clusterv1.Machine ) (ctrl.Result , error ) {
176
176
log := ctrl .LoggerFrom (ctx )
177
177
178
- // If the bootstrap data is populated, set ready and return.
179
- if m .Spec .Bootstrap .DataSecretName != nil {
180
- m .Status .BootstrapReady = true
181
- conditions .MarkTrue (m , clusterv1 .BootstrapReadyCondition )
182
- return ctrl.Result {}, nil
183
- }
184
-
185
178
// If the Bootstrap ref is nil (and so the machine should use user generated data secret), return.
186
179
if m .Spec .Bootstrap .ConfigRef == nil {
187
180
return ctrl.Result {}, nil
@@ -192,10 +185,20 @@ func (r *Reconciler) reconcileBootstrap(ctx context.Context, cluster *clusterv1.
192
185
if err != nil {
193
186
return ctrl.Result {}, err
194
187
}
188
+
189
+ // If the external object is paused return.
190
+ if externalResult .Paused {
191
+ return ctrl.Result {}, nil
192
+ }
193
+
195
194
if externalResult .RequeueAfter > 0 {
196
195
return ctrl.Result {RequeueAfter : externalResult .RequeueAfter }, nil
197
196
}
198
- if externalResult .Paused {
197
+
198
+ // If the bootstrap data is populated, set ready and return.
199
+ if m .Spec .Bootstrap .DataSecretName != nil {
200
+ m .Status .BootstrapReady = true
201
+ conditions .MarkTrue (m , clusterv1 .BootstrapReadyCondition )
199
202
return ctrl.Result {}, nil
200
203
}
201
204
bootstrapConfig := externalResult .Result
0 commit comments