feat: app rm - check if the app is undeployed before removing #61
No reviewers
Labels
No Label
bug
build
ci/cd
contributing
design
documentation
duplicate
enhancement
help wanted
invalid
meta
question
security
wontfix
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#61
Loading…
Reference in New Issue
No description provided.
Delete Branch "knoflook:dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Also fixes app rm not checking for the volumes and secrets at all.
@ -68,0 +68,4 @@
if !internal.Force {
// get app status and check if it's deployed
statuses := map[string]string{}
statuses, err = config.GetAppStatuses(appFiles)
Is there a reason for doing it like this vs
statuses, err := config.GetAppStatuses(appFiles)
nope, I just brainlessly copied it from cli/app/list.go lol
Everything looks fine but did comment on one line of the code that looks like it can be simplifed but I didn't write it so there could be a reason for that you encountered. I can't test it right now though so I'll have to ping @decentral1se to test the code when he can. I don't see why not atm though as the code looks good.
64608a5ab0
to0d548869e8
@ -68,0 +72,4 @@
logrus.Fatal(err)
}
if statuses[appName] == "deployed" {
return errors.New("app still deployed. Run abra app undeploy first. (or pass --force)")
Unsure if we want to move to the return flo uses if urfave/cli like actually outputs it to stderr. I used logrus cause its there and we will use it for debug, warn, and info. But for errors we could return to avoid the messy error output. Like the way it looks is fine for a daemon but im reconsidering that for a cli program
Merged in cc249e8187066cb9ce7a15e6ce97e843c953a135! Thanks!
I like the approach of using
config.GetAppStatuses
but I realise now that it looks up all statuses of all apps instead of just one app. We'll need to figure out a separate API for that.Pull request closed