connect: if the token given to the vault provider returns no data avoid a panic (#9806)

Improves #9800
This commit is contained in:
R.B. Boyer 2021-02-22 14:08:49 -06:00 committed by GitHub
parent 4f9b35b2d8
commit a0d26430cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

3
.changelog/9806.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
connect: if the token given to the vault provider returns no data avoid a panic
```

View File

@ -82,6 +82,8 @@ func (v *VaultProvider) Configure(cfg ProviderConfig) error {
secret, err := client.Auth().Token().LookupSelf()
if err != nil {
return err
} else if secret == nil {
return fmt.Errorf("Could not look up Vault provider token: not found")
}
var token struct {
Renewable bool