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

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

Closed
maxzinkus opened this issue May 8, 2023 · 2 comments · Fixed by #149
Closed

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

maxzinkus opened this issue May 8, 2023 · 2 comments · Fixed by #149
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@maxzinkus
Copy link
Collaborator

maxzinkus commented May 8, 2023

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
@maxzinkus maxzinkus added enhancement New feature or request in progress Issue is in the process of being resolved labels May 8, 2023
@maxzinkus maxzinkus added this to the 1.0.3 milestone May 8, 2023
@maxzinkus maxzinkus self-assigned this May 8, 2023
@maxzinkus
Copy link
Collaborator Author

I'll pick this one up :)

@maxzinkus
Copy link
Collaborator Author

#149 is ready for review @idroz ! :)

@maxzinkus maxzinkus removed the in progress Issue is in the process of being resolved label May 9, 2023
@idroz idroz closed this as completed in #149 May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant