From d1738c124d2c1fbfb5becaad2a28dafcef4574fc Mon Sep 17 00:00:00 2001 From: Googlom Date: Wed, 23 Oct 2024 16:47:01 +0500 Subject: [PATCH] add some logging to Vault login --- pkg/vault/client.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/vault/client.go b/pkg/vault/client.go index 659d94c20..4e1fc842a 100644 --- a/pkg/vault/client.go +++ b/pkg/vault/client.go @@ -90,9 +90,13 @@ func (c *Client) startTokenLifecycleManager(initialLoginDone chan struct{}) { initialLoginSucceed := false for i := 0; i < c.vaultApiClient.MaxRetries(); i++ { + if i != 0 { + log.Entry().Infof("Retrying Vault login. Attempt %d of %d", i, c.vaultApiClient.MaxRetries()) + } + vaultLoginResp, err := c.login() if err != nil { - log.Entry().Errorf("unable to authenticate to Vault: %v", err) + log.Entry().Warnf("unable to authenticate to Vault: %v", err) continue } if !initialLoginSucceed { @@ -103,7 +107,7 @@ func (c *Client) startTokenLifecycleManager(initialLoginDone chan struct{}) { tokenErr := c.manageTokenLifecycle(vaultLoginResp) if tokenErr != nil { - log.Entry().Errorf("unable to start managing token lifecycle: %v", err) + log.Entry().Warnf("unable to start managing token lifecycle: %v", err) continue } }