-
Notifications
You must be signed in to change notification settings - Fork 931
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
LXC: Improve configuration key validation and add missing completions for lxc config unset
#14584
base: main
Are you sure you want to change the base?
LXC: Improve configuration key validation and add missing completions for lxc config unset
#14584
Conversation
5bdb1ac
to
e3d591c
Compare
e3d591c
to
3d3e39b
Compare
3d3e39b
to
405119e
Compare
lxc config unset
lxc config unset
058864c
to
9592285
Compare
46078e5
to
d325f4c
Compare
d325f4c
to
6694a60
Compare
lxc config unset
lxc config unset
and improve configuration key validation
14d5b9e
to
9629d66
Compare
776e643
to
8f2ea5c
Compare
0863451
to
46ee1ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid i didn't get on well with reviewing this PR.
I had a hard time following the changes. Please could you expand the comments, commit descriptions and potentially refactor the code so its clearer to follow.
Thanks
46ee1ba
to
81c1216
Compare
I've refactored the code, expanded the use of comments, and reworded the commit messages and descriptions. |
0953121
to
fc863b9
Compare
Marking as draft until the tests are passing and code is ready for re-review. |
This commit introduces usage validation for prefixed configuration keys, ensuring that container specific prefixed keys are not set for VMs and valid keys include a subkey. Signed-off-by: Kadin Sayani <[email protected]>
5ae4426
to
8273775
Compare
…nce type Signed-off-by: Kadin Sayani <[email protected]>
…r validation in `ConfigKeyChecker` Signed-off-by: Kadin Sayani <[email protected]>
…ssage returned by `ConfigKeyChecker` Signed-off-by: Kadin Sayani <[email protected]>
Signed-off-by: Kadin Sayani <[email protected]>
8273775
to
66806e2
Compare
lxc config unset
and improve configuration key validationlxc config unset
66806e2
to
e6a2caa
Compare
Fixes #14570.
This PR reworks configuration key validation in
validConfigKey
, inlxd/instance/instance_utils.go
. The intent of the first two commits is to:user.*
andlinux.sysctl.*
; andFor example, when attempting to set
linux.sysctl.*
for a VM instance, a meaningful error message should be shown indicating the key is not valid for VMs, rather than the genericUnknown configuration key: <key>
.This PR also expands the use of the new slices
instancetype.ConfigKeyPrefixesAny
andinstancetype.ConfigKeyPrefixesContainer
to contextually provide completions for prefixed config keys when runninglxc config unset
, based on instance type.