feat: initial commit for abra app volume ls/rm #51
Labels
Clear labels
bug
build
ci/cd
critical fix
design
documentation
duplicate
easy-first-issue
enhancement
help wanted
i10n
i18n
installer
invalid
question
release
release-candidate
security
tech-debt
test
wontfix
Something is not working
go build related issues
Building things with CI/CD
https://docs.coopcloud.tech/federation/resolutions/passed/010/
UI/UX
Documenting all the things
This issue or pull request already exists
Something for new people to get stuck into. We hope it's easy!
New feature
Need some help
Everything to do with localisation
Everything to do with internationalisation
Everything to do with the install script.
Something is wrong
More information is needed
Release management
Related to the new release candidate
Security related
Unit/integration testing
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
Assignees
3wordchant
aadil (Aadil Ayub)
abra-bot (Abra Bot)
ammaratef45
amras (Sarma)
Apfelwurm
BornDeleuze
Brooke
carla
cas (Cassowary)
coopcloud
cyrnel
decentral1se (d1)
dede
devydave
fauno (fauno)
iexos
jade (Jade Ambrose)
jjsfunhouse
jmakdah2 (Jackie Makdah)
joe-irving (Joe Irving)
kawaiipunk (KawaiiPunk)
knoflook
kolaente
lambdabundesverband
linnealovespie (April)
moosemower
moritz
notplants
oxaliq (sorrel)
p4u1
pharaohgraphy (Andrew 🐦🔥❤️🔥✴️)
renovate-bot (Comrade Renovate Bot)
ripclap
simon
sixsmith (Sixsmith)
stevensting
trav (Trav Fryer)
val (val (he/him))
yksflip
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: toolshed/abra#51
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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].ServerAs 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].ServerSame 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 []stringif !internal.Force {This is great!!
bfa2237103toc3088a5158@roxxers could you review the code? Should be good now!
LGTM