File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
controlplane/kubeadm/internal/controllers Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -624,6 +624,11 @@ func (r *KubeadmControlPlaneReconciler) reconcileCertificateExpiries(ctx context
624
624
return ctrl.Result {}, nil
625
625
}
626
626
627
+ // Return if KCP is not yet initialized (no API server to contact for checking certificate expiration).
628
+ if ! controlPlane .KCP .Status .Initialized {
629
+ return ctrl.Result {}, nil
630
+ }
631
+
627
632
// Ignore machines which are being deleted.
628
633
machines := controlPlane .Machines .Filter (collections .Not (collections .HasDeletionTimestamp ))
629
634
Original file line number Diff line number Diff line change @@ -918,7 +918,9 @@ func TestReconcileCertificateExpiries(t *testing.T) {
918
918
detectedExpiry := time .Now ().Add (25 * 24 * time .Hour )
919
919
920
920
cluster := newCluster (& types.NamespacedName {Name : "foo" , Namespace : metav1 .NamespaceDefault })
921
- kcp := & controlplanev1.KubeadmControlPlane {}
921
+ kcp := & controlplanev1.KubeadmControlPlane {
922
+ Status : controlplanev1.KubeadmControlPlaneStatus {Initialized : true },
923
+ }
922
924
machineWithoutExpiryAnnotation := & clusterv1.Machine {
923
925
ObjectMeta : metav1.ObjectMeta {
924
926
Name : "machineWithoutExpiryAnnotation" ,
You can’t perform that action at this time.
0 commit comments