From 632545d1d0243164f71ef59f1dadf55131a1f80d Mon Sep 17 00:00:00 2001 From: Paulo Gomes Date: Mon, 28 Feb 2022 10:25:57 +0000 Subject: [PATCH] Use uppercase TLS in error messages Signed-off-by: Paulo Gomes --- controllers/helmchart_controller.go | 4 ++-- controllers/helmrepository_controller.go | 2 +- controllers/helmrepository_controller_test.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/helmchart_controller.go b/controllers/helmchart_controller.go index 8d0da6f37..216e4e648 100644 --- a/controllers/helmchart_controller.go +++ b/controllers/helmchart_controller.go @@ -404,7 +404,7 @@ func (r *HelmChartReconciler) buildFromHelmRepository(ctx context.Context, obj * tlsConfig, err = getter.TLSClientConfigFromSecret(*secret, repo.Spec.URL) if err != nil { e := &serror.Event{ - Err: fmt.Errorf("failed to create tls client config with secret data: %w", err), + Err: fmt.Errorf("failed to create TLS client config with secret data: %w", err), Reason: sourcev1.AuthenticationFailedReason, } conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, e.Err.Error()) @@ -776,7 +776,7 @@ func (r *HelmChartReconciler) namespacedChartRepositoryCallback(ctx context.Cont tlsConfig, err = getter.TLSClientConfigFromSecret(*secret, repo.Spec.URL) if err != nil { - return nil, fmt.Errorf("failed to create tls client config for HelmRepository '%s': %w", repo.Name, err) + return nil, fmt.Errorf("failed to create TLS client config for HelmRepository '%s': %w", repo.Name, err) } } diff --git a/controllers/helmrepository_controller.go b/controllers/helmrepository_controller.go index 671d2902d..9bae915a3 100644 --- a/controllers/helmrepository_controller.go +++ b/controllers/helmrepository_controller.go @@ -303,7 +303,7 @@ func (r *HelmRepositoryReconciler) reconcileSource(ctx context.Context, obj *sou tlsConfig, err = getter.TLSClientConfigFromSecret(secret, obj.Spec.URL) if err != nil { e := &serror.Event{ - Err: fmt.Errorf("failed to create tls client config with secret data: %w", err), + Err: fmt.Errorf("failed to create TLS client config with secret data: %w", err), Reason: sourcev1.AuthenticationFailedReason, } conditions.MarkTrue(obj, sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, e.Err.Error()) diff --git a/controllers/helmrepository_controller_test.go b/controllers/helmrepository_controller_test.go index 89a705229..458f2dfdd 100644 --- a/controllers/helmrepository_controller_test.go +++ b/controllers/helmrepository_controller_test.go @@ -364,7 +364,7 @@ func TestHelmRepositoryReconciler_reconcileSource(t *testing.T) { }, wantErr: true, assertConditions: []metav1.Condition{ - *conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "failed to create tls client config with secret data: cannot append certificate into certificate pool: invalid caFile"), + *conditions.TrueCondition(sourcev1.FetchFailedCondition, sourcev1.AuthenticationFailedReason, "failed to create TLS client config with secret data: cannot append certificate into certificate pool: invalid caFile"), }, }, {