Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Partially revert changes for ":bug: Cluster should be provisoned when cpRef and endpoint is set" #10903

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions api/v1beta1/cluster_phase_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ const (
// Cluster API Cluster controller after being created.
ClusterPhasePending = ClusterPhase("Pending")

// ClusterPhaseProvisioning is the state when the Cluster has a provider infrastructure
// object associated and can start provisioning.
// ClusterPhaseProvisioning is the state when the Cluster has a infrastructure
// object or a control plane object that can start provisioning the control plane endpoint.
ClusterPhaseProvisioning = ClusterPhase("Provisioning")

// ClusterPhaseProvisioned is the state when its
// infrastructure has been created and configured.
// ClusterPhaseProvisioned is the state when its control plane endpoint has been created and configured
// and the infrastructure object is ready (if defined).
// Note: When a cluster reaches this phase parts of the control plane or worker machines might be still provisioning.
ClusterPhaseProvisioned = ClusterPhase("Provisioned")

// ClusterPhaseDeleting is the Cluster state when a delete
Expand Down
4 changes: 1 addition & 3 deletions internal/controllers/cluster/cluster_controller_phases.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ func (r *Reconciler) reconcilePhase(_ context.Context, cluster *clusterv1.Cluste
cluster.Status.SetTypedPhase(clusterv1.ClusterPhaseProvisioning)
}

if (cluster.Spec.InfrastructureRef == nil || cluster.Status.InfrastructureReady) &&
(cluster.Spec.ControlPlaneRef == nil || cluster.Status.ControlPlaneReady) &&
cluster.Spec.ControlPlaneEndpoint.IsValid() {
if cluster.Status.InfrastructureReady && cluster.Spec.ControlPlaneEndpoint.IsValid() {
cluster.Status.SetTypedPhase(clusterv1.ClusterPhaseProvisioned)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,14 @@ func TestClusterReconciler_reconcilePhase(t *testing.T) {
Name: "test-cluster",
},
Spec: clusterv1.ClusterSpec{
ControlPlaneEndpoint: clusterv1.APIEndpoint{
ControlPlaneEndpoint: clusterv1.APIEndpoint{ // This is set by the control plane ref controller when the cluster endpoint is available.
Host: "1.2.3.4",
Port: 8443,
},
ControlPlaneRef: &corev1.ObjectReference{},
},
Status: clusterv1.ClusterStatus{
ControlPlaneReady: true,
InfrastructureReady: true, // Note, this is automatically set when there is no cluster infrastructure (no-op).
},
},

Expand Down
Loading