mirror of
https://github.com/Luzifer/yaml-vault.git
synced 2024-10-18 06:44:25 +00:00
fix bug when reading path and key with same name
This commit is contained in:
parent
a256f9988b
commit
8f66b08d02
2 changed files with 16 additions and 12 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
vault.yaml
|
||||
yaml-vault
|
4
main.go
4
main.go
|
@ -139,6 +139,7 @@ func exportFromVault(client *api.Client) error {
|
|||
}
|
||||
|
||||
func readRecurse(client *api.Client, path string, out *importFile) error {
|
||||
if strings.HasSuffix(path, "/") {
|
||||
secret, err := client.Logical().List(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error reading %s: %s", path, err)
|
||||
|
@ -152,8 +153,9 @@ func readRecurse(client *api.Client, path string, out *importFile) error {
|
|||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
secret, err = client.Logical().Read(path)
|
||||
secret, err := client.Logical().Read(path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue