fix: always check for deployed status when removing
continuous-integration/drone/push Build is passing Details

You can't delete regardless of -f if an app is deployed, the runtime
will error out. Best just deal with this for all cases then on our side.
This commit is contained in:
decentral1se 2022-01-04 11:38:07 +01:00
parent 763e7b5bff
commit b61b8f0d2a
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 7 additions and 8 deletions

View File

@ -54,14 +54,12 @@ var appRemoveCommand = &cli.Command{
logrus.Fatal(err)
}
if !internal.Force {
isDeployed, _, err := stack.IsDeployed(c.Context, cl, app.StackName())
if err != nil {
logrus.Fatal(err)
}
if isDeployed {
logrus.Fatalf("%s is still deployed. Run \"abra app undeploy %s \" or pass --force", app.Name, app.Name)
}
isDeployed, _, err := stack.IsDeployed(c.Context, cl, app.StackName())
if err != nil {
logrus.Fatal(err)
}
if isDeployed {
logrus.Fatalf("%s is still deployed. Run \"abra app undeploy %s \" or pass --force", app.Name, app.Name)
}
fs := filters.NewArgs()
@ -81,6 +79,7 @@ var appRemoveCommand = &cli.Command{
if len(secrets) > 0 {
var secretNamesToRemove []string
if !internal.Force {
secretsPrompt := &survey.MultiSelect{
Message: "which secrets do you want to remove?",