From 40eb0eb3046e57569c7e6b9679282f28ea57b771 Mon Sep 17 00:00:00 2001 From: Swastik Gour <48011880+swastik959@users.noreply.github.com> Date: Thu, 20 Jun 2024 19:40:18 +0530 Subject: [PATCH] corrected error msg (#2372) * corrected error msg Signed-off-by: swastik959 * lintted Signed-off-by: swastik959 --------- Signed-off-by: swastik959 --- pkg/knative/deployer.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/knative/deployer.go b/pkg/knative/deployer.go index d45d0c82d..5bb80b276 100644 --- a/pkg/knative/deployer.go +++ b/pkg/knative/deployer.go @@ -965,7 +965,11 @@ func checkResourcesArePresent(ctx context.Context, namespace string, referencedS for s := range *referencedSecrets { _, err := k8s.GetSecret(ctx, s, namespace) if err != nil { - errMsg += fmt.Sprintf(" referenced Secret \"%s\" is not present in namespace \"%s\"\n", s, namespace) + if errors.IsForbidden(err) { + errMsg += " Ensure that the service account has the necessary permissions to access the secret.\n" + } else { + errMsg += fmt.Sprintf(" referenced Secret \"%s\" is not present in namespace \"%s\"\n", s, namespace) + } } }