Skip to content

Commit 6f0fe30

Browse files
authored
Merge pull request #8711 from killianmuldoon/pr-reorder-cert-expiry
🐛 Allow machine rollout if cert reconcile fails
2 parents 2f2f086 + a3a02e6 commit 6f0fe30

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

controlplane/kubeadm/internal/controllers/controller.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,11 +371,6 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster *
371371
return result, err
372372
}
373373

374-
// Reconcile certificate expiry for machines that don't have the expiry annotation on KubeadmConfig yet.
375-
if result, err := r.reconcileCertificateExpiries(ctx, controlPlane); err != nil || !result.IsZero() {
376-
return result, err
377-
}
378-
379374
// Control plane machines rollout due to configuration changes (e.g. upgrades) takes precedence over other operations.
380375
needRollout := controlPlane.MachinesNeedingRollout()
381376
switch {
@@ -445,6 +440,14 @@ func (r *KubeadmControlPlaneReconciler) reconcile(ctx context.Context, cluster *
445440
return ctrl.Result{}, errors.Wrap(err, "failed to update CoreDNS deployment")
446441
}
447442

443+
// Reconcile certificate expiry for Machines that don't have the expiry annotation on KubeadmConfig yet.
444+
// Note: This requires that all control plane machines are working. We moved this to the end of the reconcile
445+
// as nothing in the same reconcile depends on it and to ensure it doesn't block anything else,
446+
// especially MHC remediation and rollout of changes to recover the control plane.
447+
if result, err := r.reconcileCertificateExpiries(ctx, controlPlane); err != nil || !result.IsZero() {
448+
return result, err
449+
}
450+
448451
return ctrl.Result{}, nil
449452
}
450453

0 commit comments

Comments
 (0)