fix: only query deployed app

Closes coop-cloud/organising#266.
This commit is contained in:
decentral1se 2021-11-26 22:24:41 +01:00
parent a90f3b7463
commit 1d6c3e98e4
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC

View File

@ -7,6 +7,7 @@ import (
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/pkg/client"
"coopcloud.tech/abra/pkg/config"
stack "coopcloud.tech/abra/pkg/upstream/stack"
"github.com/AlecAivazis/survey/v2"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
@ -48,18 +49,13 @@ var appRemoveCommand = &cli.Command{
}
}
appFiles, err := config.LoadAppFiles("")
if err != nil {
logrus.Fatal(err)
}
cl, err := client.New(app.Server)
if err != nil {
logrus.Fatal(err)
}
if !internal.Force {
// FIXME: only query for app we are interested in, not all of them!
statuses, err := config.GetAppStatuses(appFiles)
isDeployed, _, err := stack.IsDeployed(c.Context, cl, app.StackName())
if err != nil {
logrus.Fatal(err)
}