-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
incus: add completions for storage pools and volumes #597
Conversation
Signed-off-by: Adam Stephens <adam@valkor.net>
Signed-off-by: Adam Stephens <adam@valkor.net>
2eefde1
to
9c771d8
Compare
In general you can import from internal in the CLI but importing from internal/server sounds isn't ideal as there's a high chance that this imports a bunch more things and may pull cgo code too. As we're getting most config keys to be exported to a json file for documentation purposes, I think it will make sense to have the CLI similarly either import the json data at build time or even take it one step further and directly fetch the list of valid config keys through the API. |
This sounds like a great idea to me. Does this API exist already? There are a handful of key lists manually maintained in the old bash completion, and I'm doing my best to get parity (and then some) with the old completions. For an individual resource's config keys, I can just pull them from the resource. Unfortunately, I've only found a nice list of all keys for instances here: incus/internal/instance/config.go Line 30 in cff35a2
It's also possible I'm missing something, and these lists exist for the other resources too. :) |
We should get a |
Sounds good. This should still be ok to merge now, and I can add completions for the missing config keys once #600 is done. |
Is it ok to bring in code from
internal/server
? Or is there another place to get the list of all available storage config options besidesincus/internal/server/storage/utils.go
Line 478 in cff35a2
I also couldn't find a list of available storage drivers, but this is only needed for pool create.