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

CLI: Improvements to lxc config and lxc profile shell completions #14542

Conversation

kadinsayani
Copy link
Contributor

This PR includes updates to lxc/completion.go, improving the shell completion functionality for instance configuration keys.

Summary of changes:

@kadinsayani kadinsayani changed the title CLI: Improvements to lxc config and lxc profile completions CLI: Improvements to lxc config and lxc profile shell completions Nov 26, 2024
@kadinsayani kadinsayani force-pushed the 14537-missing-instance-config-completions branch from adab00b to f212bc3 Compare November 26, 2024 20:52
lxc/completion.go Outdated Show resolved Hide resolved
lxc/completion.go Outdated Show resolved Hide resolved
lxc/completion.go Outdated Show resolved Hide resolved
lxc/completion.go Outdated Show resolved Hide resolved
This commit reworks the `cmpInstanceKeys` function to use the metadata
API rather than `instancetype`.

Signed-off-by: Kadin Sayani <[email protected]>
@kadinsayani kadinsayani force-pushed the 14537-missing-instance-config-completions branch 2 times, most recently from 63e2d12 to bde5185 Compare November 26, 2024 21:47
lxc/completion.go Outdated Show resolved Hide resolved
lxc/completion.go Outdated Show resolved Hide resolved
This commit adds a completion function for completing config keys which
are currently set.

Signed-off-by: Kadin Sayani <[email protected]>
@kadinsayani kadinsayani force-pushed the 14537-missing-instance-config-completions branch from bde5185 to e9d18f2 Compare November 26, 2024 22:14
Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tomponline tomponline merged commit 5159972 into canonical:main Nov 27, 2024
26 checks passed
@tomponline
Copy link
Member

@kadinsayani @simondeziel has any consideration been thought about wrt to caching the metdata api response for a particular remote so it doesnt have to keep re-requesting it (perhaps tied to the version number returned by the remote's /1.0 api)?

@kadinsayani
Copy link
Contributor Author

@kadinsayani @simondeziel has any consideration been thought about wrt to caching the metdata api response for a particular remote so it doesnt have to keep re-requesting it (perhaps tied to the version number returned by the remote's /1.0 api)?

I'll include this with #14543 :)

@kadinsayani kadinsayani deleted the 14537-missing-instance-config-completions branch November 27, 2024 13:17
@simondeziel
Copy link
Member

@kadinsayani @simondeziel has any consideration been thought about wrt to caching the metdata api response for a particular remote so it doesnt have to keep re-requesting it (perhaps tied to the version number returned by the remote's /1.0 api)?

That's an interesting idea, thanks for suggesting! I'd probably tie it to the server_pid so that even minor snap updates also invalidate the cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing instance config suggestions from tab completion
3 participants