Delete application when container doesn't exist

This commit is contained in:
Adam Štrauch 2020-08-22 00:13:07 +02:00
parent ba748f1134
commit f6f26e89de
Signed by: cx
GPG Key ID: 018304FFA8988F8D

View File

@ -457,10 +457,16 @@ func main() {
App: app,
}
err = container.Delete()
status, err := container.Status()
if err != nil {
return c.JSONPretty(http.StatusInternalServerError, Message{Message: err.Error()}, JSONIndent)
}
if status != "no-container" {
err = container.Delete()
if err != nil {
return c.JSONPretty(http.StatusInternalServerError, Message{Message: err.Error()}, JSONIndent)
}
}
err = apps.Delete(name)
if err != nil {