osd: clarify vault auth error message

When kube authentication is used, let's clarify the error message and
hopefully lead to a better understanding on where to look for.
It could be misleading to print "token auth" when using kube auth,
although internally a token is used (the JWT from the Service
Account).

Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 74081d90d3)
This commit is contained in:
Sébastien Han authored and mergify-bot committed 2022-03-10 17:25:29 +00:00
1 parent 17a64b61f4
commit 3cf062243d
1 file changed
+3
+3
View File
@@ -93,6 +93,9 @@ func newVaultClient(clusterdContext *clusterd.Context, namespace string, secretC
// Both return a token
token, _, err := utils.Authenticate(client, c)
if err != nil {
if authType := GetParam(secretConfig, vault.AuthMethod); authType == vault.AuthMethodKubernetes {
return nil, errors.Wrap(err, "failed to get vault authentication token for kubernetes authentication (missing Service Account?)")
}
return nil, errors.Wrap(err, "failed to get vault authentication token")
}