Skip to content

Commit

Permalink
Move the check for cluster being provisioned to in the filter phase.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigkevmcd committed Sep 20, 2022
1 parent 5132b0e commit f79891a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions controllers/clusterbootstrapconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ func (r *ClusterBootstrapConfigReconciler) Reconcile(ctx context.Context, req ct
logger.Info("identified clusters for reconciliation", "clusterCount", len(clusters))

for _, cluster := range clusters {
if clusterBootstrapConfig.Spec.RequireClusterProvisioned {
if !isProvisioned(cluster) {
logger.Info("waiting for cluster to be provisioned", "cluster", cluster.Name)
continue
}
}

if clusterBootstrapConfig.Spec.RequireClusterReady {
clusterName := types.NamespacedName{Name: cluster.GetName(), Namespace: cluster.GetNamespace()}
clusterClient, err := r.clientForCluster(ctx, clusterName)
Expand Down Expand Up @@ -171,6 +164,13 @@ func (r *ClusterBootstrapConfigReconciler) getClustersBySelector(ctx context.Con
logger.Info("cluster discarded - not ready", "phase", cluster.Status)
continue
}
if spec.RequireClusterProvisioned {
if !isProvisioned(cluster) {
logger.Info("waiting for cluster to be provisioned", "cluster", cluster.Name)
continue
}
}

if metav1.HasAnnotation(cluster.ObjectMeta, capiv1alpha1.BootstrappedAnnotation) {
continue
}
Expand Down

0 comments on commit f79891a

Please sign in to comment.