feat: initial commit for abra app volume ls/rm #51
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: coop-cloud/abra#51
Loading…
Reference in New Issue
No description provided.
Delete Branch "knoflook/abra:secret-create"
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?
roxxers referenced this pull request2021-08-12 12:38:49 +00:00
Just needs to check for if the app exists to work great out of the box, i gave you a code snippet to fix that.
@ -0,0 +21,4 @@
Action: func(c *cli.Context) error {
appName := c.Args().First()
if appName == "" {
internal.ShowSubcommandHelpAndError(c, errors.New("No app name provided!"))
Style: Errors should not start with capital. https://staticcheck.io/docs/checks#ST1005
I am also unsure of using this error vs just printing the help page without the error. Since not giving the first arg seems to do so without error for other commands. This is more a thing for future clean up tbf and me rambling.
@ -0,0 +27,4 @@
if err != nil {
logrus.Fatal(err)
}
host := appFiles[appName].Server
As discussed with my panic hour, this just isn't checking if the app itself exists leading to a weird error that is very confusing. Like "Context '' does not exist."
Just tested this and it works great with this addition.
Just realised this should be simplified to
@ -0,0 +42,4 @@
if err != nil {
logrus.Fatal(err)
}
fmt.Println("DRIVER\t\t\tVOLUME NAME")
Minimal: We use table creation in the formatter for the abra/cli package
@ -0,0 +66,4 @@
if err != nil {
logrus.Fatal(err)
}
host := appFiles[appName].Server
Same issue as before. Since you are doing this twice you could refactor some of the calls here into their own functions so both commands can use them?
@ -0,0 +86,4 @@
volumeNames = append(volumeNames, volume.Name)
}
var volumesToRemove []string
if !internal.Force {
This is great!!
bfa2237103
toc3088a5158
@roxxers could you review the code? Should be good now!
LGTM