Skip to content

Commit

Permalink
nil secrets as recoverable to keep renew attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmood Ali committed Nov 20, 2018
1 parent 118300a commit 3a57b9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nomad/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -583,15 +583,15 @@ func (v *vaultClient) renew() (bool, error) {
// Attempt to renew the token
secret, err := v.auth.RenewSelf(v.tokenData.CreationTTL)
if err != nil {

// Check if there is a permission denied
recoverable := !structs.VaultUnrecoverableError.MatchString(err.Error())
return recoverable, fmt.Errorf("failed to renew the vault token: %v", err)
}

if secret == nil {
// It's possible for RenewSelf to return (nil, nil) if the
// response body from Vault is empty.
return fmt.Errorf("renewal failed: empty response from vault")
return true, fmt.Errorf("renewal failed: empty response from vault")
}

// these treated as transient errors, where can keep renewing
Expand Down

0 comments on commit 3a57b9c

Please sign in to comment.