From 3cf062243d388002e7dbea62b285c298bcc985da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 10 Mar 2022 11:32:10 +0100 Subject: [PATCH] osd: clarify vault auth error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 74081d90d307b961fdc2980d440ec507f73489a5) --- pkg/daemon/ceph/osd/kms/vault_api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/daemon/ceph/osd/kms/vault_api.go b/pkg/daemon/ceph/osd/kms/vault_api.go index 593ccca7b..c2e489b92 100644 --- a/pkg/daemon/ceph/osd/kms/vault_api.go +++ b/pkg/daemon/ceph/osd/kms/vault_api.go @@ -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") }