Skip to content

Commit

Permalink
modify logging (#5158)
Browse files Browse the repository at this point in the history
  • Loading branch information
Googlom authored Oct 23, 2024
1 parent 7b08d47 commit 7b7ba77
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/vault/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
}
}
Expand Down

0 comments on commit 7b7ba77

Please sign in to comment.