Skip to content

Commit e8475fe

Browse files
authored
Merge pull request #4904 from hashicorp/b-vault-panic
vault: fix panic by checking for nil secret
2 parents 1f98eed + f5f5948 commit e8475fe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

nomad/vault.go

+5
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@ func (v *vaultClient) renew() error {
547547
if err != nil {
548548
return err
549549
}
550+
if secret == nil {
551+
// It's possible for RenewSelf to return (nil, nil) if the
552+
// response body from Vault is empty.
553+
return fmt.Errorf("renewal failed: empty response from vault")
554+
}
550555

551556
auth := secret.Auth
552557
if auth == nil {

0 commit comments

Comments
 (0)