fix: warn if secrets still exist
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
cellarspoon 2021-12-13 12:29:26 +01:00
parent 37ab9a9c08
commit 8215bb455b
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410

View File

@ -140,7 +140,12 @@ func GenerateSecrets(secretEnvVars map[string]string, appName, server string) (m
return
}
if err := client.StoreSecret(secretRemoteName, passwords[0], server); err != nil {
if strings.Contains(err.Error(), "AlreadyExists") {
logrus.Warnf("%s already exists, moving on...", secretRemoteName)
ch <- nil
} else {
ch <- err
}
return
}
secrets[secretName] = passwords[0]
@ -151,8 +156,14 @@ func GenerateSecrets(secretEnvVars map[string]string, appName, server string) (m
return
}
if err := client.StoreSecret(secretRemoteName, passphrases[0], server); err != nil {
if strings.Contains(err.Error(), "AlreadyExists") {
logrus.Warnf("%s already exists, moving on...", secretRemoteName)
ch <- nil
} else {
ch <- err
}
return
}
secrets[secretName] = passphrases[0]
}
ch <- nil