Skip to content

Commit

Permalink
don't err on Vault Get 404
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasmitchell committed Oct 16, 2019
1 parent abf3247 commit 0b412fc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions storage/vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,16 @@ func newVaultAccessor(conf VaultConfig) (*VaultAccessor, error) {
func (v *VaultAccessor) Get(path string) (map[string]string, error) {
ret := make(map[string]string)
_, err := v.client.Get(path, &ret, nil)
if err != nil {
//This might be worth checking to see if
// 1. The mount is v2
// 2. The secret metadata exists
// 3. The latest version is deleted
// But for now, if we listed it, this is probably why we'd get a 404.
if vaultkv.IsNotFound(err) {
err = nil
}
}
return ret, err
}

Expand Down

0 comments on commit 0b412fc

Please sign in to comment.