From 6d62835734cd33fe8edc007ecd9ea36d3c0cd1f6 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Tue, 10 Mar 2020 15:10:14 -0400 Subject: [PATCH] fix: correct issues in app creation and deletion --- plugins/apps/.gitignore | 1 + plugins/apps/functions.go | 8 ++------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/apps/.gitignore b/plugins/apps/.gitignore index 06649f17c..fbeada67e 100644 --- a/plugins/apps/.gitignore +++ b/plugins/apps/.gitignore @@ -2,5 +2,6 @@ /subcommands/* /triggers/* /triggers +/app-* /post-* /report diff --git a/plugins/apps/functions.go b/plugins/apps/functions.go index ca5574893..6729ac36c 100644 --- a/plugins/apps/functions.go +++ b/plugins/apps/functions.go @@ -36,7 +36,7 @@ func createApp(appName string) error { return err } - if err := appExists(appName); err != nil { + if err := appExists(appName); err == nil { return errors.New("Name is already taken") } @@ -56,11 +56,6 @@ func destroyApp(appName string) error { return err } - imageTag, err := common.GetRunningImageTag(appName) - if err != nil { - return err - } - if os.Getenv("DOKKU_APPS_FORCE_DELETE") != "1" { if err := common.AskForDestructiveConfirmation(appName, "app"); err != nil { return err @@ -69,6 +64,7 @@ func destroyApp(appName string) error { common.LogInfo1(fmt.Sprintf("Destroying %s (including all add-ons)", appName)) + imageTag, _ := common.GetRunningImageTag(appName) if err := common.PlugnTrigger("pre-delete", []string{appName, imageTag}...); err != nil { return err }