mirror of
https://github.com/Luzifer/vault2env.git
synced 2024-11-08 16:20:07 +00:00
Fix: Do not try to access data on error
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b68754230a
commit
b0c825098a
1 changed files with 7 additions and 1 deletions
8
main.go
8
main.go
|
@ -114,7 +114,13 @@ func main() {
|
|||
for _, vaultKey := range cfg.VaultKeys {
|
||||
data, err := client.Logical().Read(vaultKey)
|
||||
if err != nil {
|
||||
log.Errorf("Unable to fetch data: %s", err)
|
||||
log.Errorf("Unable to fetch data for key %q: %s", vaultKey, err)
|
||||
continue
|
||||
}
|
||||
|
||||
if data.Data == nil {
|
||||
log.Errorf("Vault key %q did not contain data", vaultKey)
|
||||
continue
|
||||
}
|
||||
|
||||
for k, v := range data.Data {
|
||||
|
|
Loading…
Reference in a new issue