Skip to content

Commit 3cdfa0e

Browse files
committed
fix: mark control plane as initialized as soon as endpoints are ready
This should resolve a problem when there's a "deadlock" between CAPI core MachineController and CACPPT: CAPI core waits for the control plane to be initialized to start watching workload cluster Nodes to pick up `.spec.ProviderID` changes, while CACPPT relies on the MachineController to update the Machine status. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
1 parent 04b0570 commit 3cdfa0e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/taloscontrolplane_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,11 @@ func (r *TalosControlPlaneReconciler) updateStatus(ctx context.Context, tcp *con
552552
return nil
553553
}
554554

555+
// if we were able to fetch some resources via control plane endpoint,
556+
// workload cluster control plane endpoint is available
557+
tcp.Status.Initialized = true
558+
conditions.MarkTrue(tcp, controlplanev1.AvailableCondition)
559+
555560
for _, node := range nodes.Items {
556561
if util.IsNodeReady(&node) {
557562
tcp.Status.ReadyReplicas++
@@ -560,11 +565,6 @@ func (r *TalosControlPlaneReconciler) updateStatus(ctx context.Context, tcp *con
560565

561566
tcp.Status.UnavailableReplicas = replicas - tcp.Status.ReadyReplicas
562567

563-
if len(nodes.Items) > 0 {
564-
tcp.Status.Initialized = true
565-
conditions.MarkTrue(tcp, controlplanev1.AvailableCondition)
566-
}
567-
568568
if tcp.Status.ReadyReplicas > 0 {
569569
tcp.Status.Ready = true
570570
}

0 commit comments

Comments
 (0)