Skip to content

Commit 1da6873

Browse files
authored
fix: panic reference to deleted version of secret (#411)
1 parent 6396995 commit 1da6873

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/backends/vault.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ func (v *Vault) GetSecrets(path string, version string, annotations map[string]s
7373

7474
if kvVersion == "2" {
7575
if _, ok := secret.Data["data"]; ok {
76-
return secret.Data["data"].(map[string]interface{}), nil
76+
if secret.Data["data"] != nil {
77+
return secret.Data["data"].(map[string]interface{}), nil
78+
}
79+
return nil, fmt.Errorf("The secret version %s for Vault path %s is nil - is this version of the secret deleted?", version, path)
7780
}
7881
if len(secret.Data) == 0 {
7982
return nil, fmt.Errorf("The Vault path: %s is empty - did you forget to include /data/ in the Vault path for kv-v2?", path)

0 commit comments

Comments
 (0)