From af5921f4da43223ad0c878d43c82569e5c3ad867 Mon Sep 17 00:00:00 2001 From: Guillaume LEGRAIN Date: Mon, 3 Jun 2024 11:24:28 +0200 Subject: [PATCH] fix(token-was-not-correctly-renewed-for-the-renewer-and-revoker): use the c.SetToken to correctly change the token with the new one --- pkg/vault/handle_token.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/vault/handle_token.go b/pkg/vault/handle_token.go index 9b3935c..49fbeb9 100644 --- a/pkg/vault/handle_token.go +++ b/pkg/vault/handle_token.go @@ -390,10 +390,11 @@ func (c *Connector) StartTokenRenewal(ctx context.Context, cfg *config.Config) { c.Log.Errorf("Failed to renew Vault token: %v", err) c.Log.Info("Trying to reconnect to Vault") newConn, err := ConnectToVault(ctx, cfg) - c.K8sSaVaultToken = newConn.K8sSaVaultToken if err != nil { c.Log.Fatalf("Can't reconnect to VAULT: %v", err) } + c.K8sSaVaultToken = newConn.K8sSaVaultToken + c.SetToken(newConn.K8sSaVaultToken) } c.Log.Debug("Token has been renewed succefully !") }