From 0b412fcc10c6dc8881bbf7842cee72164076e0de Mon Sep 17 00:00:00 2001 From: Thomas Mitchell Date: Wed, 16 Oct 2019 18:44:14 -0400 Subject: [PATCH] don't err on Vault Get 404 --- storage/vault.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/storage/vault.go b/storage/vault.go index 2e37d99..57bd0de 100644 --- a/storage/vault.go +++ b/storage/vault.go @@ -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 }