Skip to content

Commit f79891a

Browse files
committed
Move the check for cluster being provisioned to in the filter phase.
1 parent 5132b0e commit f79891a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: controllers/clusterbootstrapconfig_controller.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,6 @@ func (r *ClusterBootstrapConfigReconciler) Reconcile(ctx context.Context, req ct
8585
logger.Info("identified clusters for reconciliation", "clusterCount", len(clusters))
8686

8787
for _, cluster := range clusters {
88-
if clusterBootstrapConfig.Spec.RequireClusterProvisioned {
89-
if !isProvisioned(cluster) {
90-
logger.Info("waiting for cluster to be provisioned", "cluster", cluster.Name)
91-
continue
92-
}
93-
}
94-
9588
if clusterBootstrapConfig.Spec.RequireClusterReady {
9689
clusterName := types.NamespacedName{Name: cluster.GetName(), Namespace: cluster.GetNamespace()}
9790
clusterClient, err := r.clientForCluster(ctx, clusterName)
@@ -171,6 +164,13 @@ func (r *ClusterBootstrapConfigReconciler) getClustersBySelector(ctx context.Con
171164
logger.Info("cluster discarded - not ready", "phase", cluster.Status)
172165
continue
173166
}
167+
if spec.RequireClusterProvisioned {
168+
if !isProvisioned(cluster) {
169+
logger.Info("waiting for cluster to be provisioned", "cluster", cluster.Name)
170+
continue
171+
}
172+
}
173+
174174
if metav1.HasAnnotation(cluster.ObjectMeta, capiv1alpha1.BootstrappedAnnotation) {
175175
continue
176176
}

0 commit comments

Comments
 (0)