1
0
Fork 0
mirror of https://github.com/Luzifer/vault2env.git synced 2024-11-09 16:50:06 +00:00

Fix: Do not try to access data on error

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2017-08-07 15:36:42 +02:00
parent b68754230a
commit b0c825098a
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -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 {