beringresearch / macpine

Lightweight Linux VMs on MacOS

Home Page:https://beringresearch.github.io/macpine/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Validate `config.yaml` at the end of `alpine edit`

maxzinkus opened this issue · comments

To make alpine edit more useful, at the end, it should do a quick parse & validate of the config.yaml file(s) which were edited and relay a message about their validity, erroring if one or more are invalid:

  1. malformed YAML
  2. alias is invalid
  3. image not found in ~/.macpine/cache or not on filesystem
  4. arch not one of aarch64 or x86_64
  5. cpu not a positive integer
  6. memory not a positive integer >= 256
  7. disk not a valid size
  8. mount not a directory on the host
  9. port string invalid
  10. sshport not a positive integer
  11. location not correct (~/.macpine/instance-name matching alias)
  • 0 can be checked with the yaml library
  • 1 can be checked with cmd/rename.go:100 validateName(...)
  • 2-9 can be checked with cmd/launch.go:46 correctArguments(...)
  • 10 can be checked manually

I'll pick this one up :)

#149 is ready for review @idroz ! :)