Skip to content

Commit af5921f

Browse files
committed
fix(token-was-not-correctly-renewed-for-the-renewer-and-revoker): use the c.SetToken to correctly change the token with the new one
1 parent 80df666 commit af5921f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/vault/handle_token.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,11 @@ func (c *Connector) StartTokenRenewal(ctx context.Context, cfg *config.Config) {
390390
c.Log.Errorf("Failed to renew Vault token: %v", err)
391391
c.Log.Info("Trying to reconnect to Vault")
392392
newConn, err := ConnectToVault(ctx, cfg)
393-
c.K8sSaVaultToken = newConn.K8sSaVaultToken
394393
if err != nil {
395394
c.Log.Fatalf("Can't reconnect to VAULT: %v", err)
396395
}
396+
c.K8sSaVaultToken = newConn.K8sSaVaultToken
397+
c.SetToken(newConn.K8sSaVaultToken)
397398
}
398399
c.Log.Debug("Token has been renewed succefully !")
399400
}

0 commit comments

Comments
 (0)