Skip to content

Commit 7b7ba77

Browse files
authored
modify logging (#5158)
1 parent 7b08d47 commit 7b7ba77

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/vault/client.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@ func (c *Client) startTokenLifecycleManager(initialLoginDone chan struct{}) {
9090

9191
initialLoginSucceed := false
9292
for i := 0; i < c.vaultApiClient.MaxRetries(); i++ {
93+
if i != 0 {
94+
log.Entry().Infof("Retrying Vault login. Attempt %d of %d", i, c.vaultApiClient.MaxRetries())
95+
}
96+
9397
vaultLoginResp, err := c.login()
9498
if err != nil {
95-
log.Entry().Errorf("unable to authenticate to Vault: %v", err)
99+
log.Entry().Warnf("unable to authenticate to Vault: %v", err)
96100
continue
97101
}
98102
if !initialLoginSucceed {
@@ -103,7 +107,7 @@ func (c *Client) startTokenLifecycleManager(initialLoginDone chan struct{}) {
103107

104108
tokenErr := c.manageTokenLifecycle(vaultLoginResp)
105109
if tokenErr != nil {
106-
log.Entry().Errorf("unable to start managing token lifecycle: %v", err)
110+
log.Entry().Warnf("unable to start managing token lifecycle: %v", err)
107111
continue
108112
}
109113
}

0 commit comments

Comments
 (0)