From 47283d8e5d68cafe6966da49ddd38503a164866a Mon Sep 17 00:00:00 2001 From: Martin Schuppert Date: Thu, 5 Sep 2024 14:32:43 +0200 Subject: [PATCH] Fix ValidateCertSecret error message right now err.Error() renders as ~~~ secrets \"%s not found in namespace %s\" not found ~~~ This changes the msg so that it returns ~~~ secrets \"%s in namespace %s\" not found ~~~ Jira: OSPRH-9991 Signed-off-by: Martin Schuppert --- modules/common/tls/tls.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/common/tls/tls.go b/modules/common/tls/tls.go index 3d192a05..b575ba2f 100644 --- a/modules/common/tls/tls.go +++ b/modules/common/tls/tls.go @@ -260,7 +260,7 @@ func ValidateCACertSecret( } else if (ctrlResult != ctrl.Result{}) { return "", k8s_errors.NewNotFound( appsv1.Resource("Secret"), - fmt.Sprintf("%s not found in namespace %s", caSecret.Name, caSecret.Namespace), + fmt.Sprintf("%s in namespace %s", caSecret.Name, caSecret.Namespace), ) } @@ -286,7 +286,7 @@ func (s *Service) ValidateCertSecret(ctx context.Context, h *helper.Helper, name } else if (ctrlResult != ctrl.Result{}) { return "", k8s_errors.NewNotFound( corev1.Resource(corev1.ResourceSecrets.String()), - fmt.Sprintf("%s not found in namespace %s", s.SecretName, namespace), + fmt.Sprintf("%s in namespace %s", s.SecretName, namespace), ) }