diff --git a/bootstrap/kubeadm/api/v1alpha3/condition_consts.go b/bootstrap/kubeadm/api/v1alpha3/condition_consts.go index e73447ce7d9a..345ab71e7ba4 100644 --- a/bootstrap/kubeadm/api/v1alpha3/condition_consts.go +++ b/bootstrap/kubeadm/api/v1alpha3/condition_consts.go @@ -62,7 +62,7 @@ const ( // automatically recover from them. CertificatesGenerationFailedReason = "CertificatesGenerationFailed" - // CertificatesCorrupted (Severity=Error) documents a KubeadmConfig controller detecting + // CertificatesCorruptedReason (Severity=Error) documents a KubeadmConfig controller detecting // an error while while retrieving certificates for a joining node. - CertificatesCorrupted = "CertificatesCorrupted" + CertificatesCorruptedReason = "CertificatesCorrupted" ) diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go index ca9662c3d679..46ba977e0434 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go @@ -420,11 +420,11 @@ func (r *KubeadmConfigReconciler) joinWorker(ctx context.Context, scope *Scope) util.ObjectKey(scope.Cluster), ) if err != nil { - conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorrupted, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorruptedReason, clusterv1.ConditionSeverityError, err.Error()) return ctrl.Result{}, err } if err := certificates.EnsureAllExist(); err != nil { - conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorrupted, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorruptedReason, clusterv1.ConditionSeverityError, err.Error()) return ctrl.Result{}, err } conditions.MarkTrue(scope.Config, bootstrapv1.CertificatesAvailableCondition) @@ -501,11 +501,11 @@ func (r *KubeadmConfigReconciler) joinControlplane(ctx context.Context, scope *S util.ObjectKey(scope.Cluster), ) if err != nil { - conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorrupted, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorruptedReason, clusterv1.ConditionSeverityError, err.Error()) return ctrl.Result{}, err } if err := certificates.EnsureAllExist(); err != nil { - conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorrupted, clusterv1.ConditionSeverityError, err.Error()) + conditions.MarkFalse(scope.Config, bootstrapv1.CertificatesAvailableCondition, bootstrapv1.CertificatesCorruptedReason, clusterv1.ConditionSeverityError, err.Error()) return ctrl.Result{}, err } conditions.MarkTrue(scope.Config, bootstrapv1.CertificatesAvailableCondition) diff --git a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go index 19af7d07cdf9..071c4c094b53 100644 --- a/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go +++ b/bootstrap/kubeadm/controllers/kubeadmconfig_controller_test.go @@ -423,7 +423,7 @@ func TestKubeadmConfigReconciler_Reconcile_RequeueJoiningNodesIfControlPlaneNotI g.Expect(err).NotTo(HaveOccurred()) g.Expect(result.Requeue).To(BeFalse()) g.Expect(result.RequeueAfter).To(Equal(30 * time.Second)) - assertHasFalseCondition(g, myclient, tc.request, bootstrapv1.DataSecretAvailableCondition, clusterv1.ConditionSeverityInfo, bootstrapv1.WaitingForControlPlaneInitializedReason) + assertHasFalseCondition(g, myclient, tc.request, bootstrapv1.DataSecretAvailableCondition, clusterv1.ConditionSeverityInfo, bootstrapv1.WaitingForControlPlaneAvailableReason) }) } } @@ -468,7 +468,7 @@ func TestKubeadmConfigReconciler_Reconcile_GenerateCloudConfigData(t *testing.T) g.Expect(err).NotTo(HaveOccurred()) g.Expect(cfg.Status.Ready).To(BeTrue()) g.Expect(cfg.Status.DataSecretName).NotTo(BeNil()) - assertHasTrueCondition(g, myclient, request, bootstrapv1.CertificatesGeneratedCondition) + assertHasTrueCondition(g, myclient, request, bootstrapv1.CertificatesAvailableCondition) assertHasTrueCondition(g, myclient, request, bootstrapv1.DataSecretAvailableCondition) // Ensure that we don't fail trying to refresh any bootstrap tokens