beringresearch / macpine

Lightweight Linux VMs on MacOS
https://beringresearch.github.io/macpine/
Apache License 2.0
898 stars 22 forks source link

Tagging VMs #95

Closed maxzinkus closed 1 year ago

maxzinkus commented 1 year ago

It would be useful to have a comma-separated string Tags field in config.yaml for the following features:

Tags could be managed with alpine edit or by editing config.yaml directly, or with an alpine tag <vm name> <tag> to add a tag, and alpine tag -d <vm name> <tag> to remove a tag if found.

Tags could be made case-non-sensitive, and globally lower-cased, for implementation convenience.

Examples: alpine publish -t fleet: publish all VMs with tag fleet

alpine exec -t service "chronyc refresh && chronyc makestep && hwclock -w": update chrony NTP daemon and sync hardware clock on all VMs with tag service

alpine list -t active: display status information for VMs tagged active

maxzinkus commented 1 year ago

104 adds tag support, but TODO remains to make tags useful in commands.

maxzinkus commented 1 year ago

I think +tag_name is cleaner than -t because -t will require reworking how commands are parsed across the board and breaks the pattern that's been established in how commands are run (command, then optional args, then vm target -- IMO it's weird to have one optional arg that makes vm target not apply). Thus,

TODO: