corrected error msg (#2372)

* corrected error msg

Signed-off-by: swastik959 <Sswastik959@gmail.com>

* lintted

Signed-off-by: swastik959 <Sswastik959@gmail.com>

---------

Signed-off-by: swastik959 <Sswastik959@gmail.com>
This commit is contained in:
Swastik Gour 2024-06-20 19:40:18 +05:30 committed by GitHub
parent 9b30089a00
commit 40eb0eb304
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -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)
}
}
}