Skip to content

Commit

Permalink
porting vault fix from consul-template
Browse files Browse the repository at this point in the history
Fixes issue with vault's API returning pointer types for data field.
Requires a nil check.

Consul-template PR with more info.
hashicorp/consul-template#1447
  • Loading branch information
eikenb committed Jan 22, 2021
1 parent a06a4c3 commit 214251f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/dependency/vault_common.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dependency

import (
"fmt"
"math/rand"
"path"
"strings"
Expand Down Expand Up @@ -258,6 +259,9 @@ func isKVv2(client *api.Client, path string) (string, bool, error) {
if err != nil {
return "", false, err
}
if secret == nil {
return "", false, fmt.Errorf("secret at path %s does not exist", path)
}
var mountPath string
if mountPathRaw, ok := secret.Data["path"]; ok {
mountPath = mountPathRaw.(string)
Expand Down

0 comments on commit 214251f

Please sign in to comment.