Skip to content

Commit

Permalink
add Reason suffix and fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziopandini committed Jun 5, 2020
1 parent 7b9f7ef commit 1aff5d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bootstrap/kubeadm/api/v1alpha3/condition_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
8 changes: 4 additions & 4 deletions bootstrap/kubeadm/controllers/kubeadmconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1aff5d8

Please sign in to comment.