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 unsetlxc config unset
058864c to
9592285
Compare
46078e5 to
d325f4c
Compare
d325f4c to
6694a60
Compare
lxc config unsetlxc config unset and improve configuration key validation
14d5b9e to
9629d66
Compare
776e643 to
8f2ea5c
Compare
tomponline
left a comment
There was a problem hiding this comment.
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 <kadin.sayani@canonical.com>
5ae4426 to
8273775
Compare
…nce type Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
…r validation in `ConfigKeyChecker` Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
…ssage returned by `ConfigKeyChecker` Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
8273775 to
66806e2
Compare
lxc config unset and improve configuration key validationlxc config unset
66806e2 to
e6a2caa
Compare
|
@kadinsayani I think this PR caused a regression: https://github.com/canonical/lxd-ci/actions/runs/12367790805/job/34516721509#step:11:93 |
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.ConfigKeyPrefixesAnyandinstancetype.ConfigKeyPrefixesContainerto contextually provide completions for prefixed config keys when runninglxc config unset, based on instance type.