Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle multiple VM name arguments #112

Merged
merged 13 commits into from
Apr 1, 2023
Merged

Handle multiple VM name arguments #112

merged 13 commits into from
Apr 1, 2023

Conversation

maxzinkus
Copy link
Collaborator

Add support for multiple VM arguments.

Commands

  • delete
  • edit (passes each as an argument to $EDITOR -- vim handles this nicely using buffers)
  • publish
  • start
  • stop

Notes

  • Added a CmdResult type to utils/utils.go in order to aggregate errors as we iterate through VMs. This way, one failed iteration won't cancel the remainder.
  • Added a check to skip duplicate names (e.g. alpine publish foo foo will only publish once).
  • Removed VM already stopped error from qemu/ops.go:Stop() to avoid weirdness. This now just fails silently/is idempotent.
  • AutoCompleteVMNames() is already ready for multiple VMs, works as intended.

Additional note

During testing, I ran launch many times. One time, I got a really unfortunate VM name from the randomizer. So, I went through the dictionaries (adjectives.txt and nouns.txt) and manually cleaned them up. No guarantee that I did a perfect job, but it should help mitigate issues in the future. In summary:

  • Removed explicit or explicit-adjacent words
  • Removed words that are very negatively constructed and may cause confusion/concern
  • Removed words that specify individual people (person, girl, boyfriend, etc)
  • Removed words with various systems meanings to avoid confusion (error, data, etc)

Closes #87
Closes #88
Closes #89
Closes #91

I realized while testing `launch` that many "fun" possibilities were
available to the name randomizer, including a few choice examples:
* `abusive-childhood`
* `superior-race`
* `force-sex`

Needless to say, this commit cleans up the dictionaries a little in the
hopes that these and other *really unfortunate* combinations never
arise.
* `delete`
* `edit`
* `start`
* `stop`
@maxzinkus
Copy link
Collaborator Author

@idroz :)

@maxzinkus
Copy link
Collaborator Author

I didn't add a ParseVMNames helper function because Tags are still WIP. I'll roll up this functionality and de-duplicate it across the commands, and add tag support, all in the next/final Tags PR.

@idroz idroz merged commit 0340539 into beringresearch:main Apr 1, 2023
@maxzinkus maxzinkus deleted the multiple-vms branch April 1, 2023 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants