Skip to content

Commit 4d4f17a

Browse files
address comments
1 parent ee1d484 commit 4d4f17a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

controllers/machine_controller_phases.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,14 @@ func (r *MachineReconciler) reconcileExternal(ctx context.Context, cluster *clus
159159

160160
// reconcileBootstrap reconciles the Spec.Bootstrap.ConfigRef object on a Machine.
161161
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.
162170
if m.Spec.Bootstrap.ConfigRef == nil {
163171
return nil
164172
}
@@ -190,13 +198,6 @@ func (r *MachineReconciler) reconcileBootstrap(ctx context.Context, cluster *clu
190198
conditions.WithFallbackValue(ready, clusterv1.WaitingForDataSecretFallbackReason, clusterv1.ConditionSeverityInfo, ""),
191199
)
192200

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-
200201
// If the bootstrap provider is not ready, requeue.
201202
if !ready {
202203
return errors.Wrapf(&capierrors.RequeueAfterError{RequeueAfter: externalReadyWait},

0 commit comments

Comments
 (0)