Skip to content

Commit

Permalink
🥅 Init data when failed to get
Browse files Browse the repository at this point in the history
  • Loading branch information
DUBOIS Charles committed Oct 25, 2023
1 parent 65b65b2 commit 68fab50
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/vault_push_var.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ var vaultPushEnv = &cobra.Command{

// Get Vault secret data
data, err := getSecretData(vc, secretPath)
if err != nil {
if err != nil && err.Error() != "no secret found at path "+secretPath {
ErrorToEval(fmt.Errorf("failed to get secret from Vault: %s", err))
return
}
if err.Error() == "no secret found at path "+secretPath {
data = make(map[string]interface{})
}

key := viper.GetString("vault-push-secret-key")
if key == "" {
Expand Down

0 comments on commit 68fab50

Please sign in to comment.