Skip to content

Commit

Permalink
lxc/completion: Add missing completions for lxc config unset
Browse files Browse the repository at this point in the history
Signed-off-by: Kadin Sayani <[email protected]>
  • Loading branch information
kadinsayani committed Dec 4, 2024
1 parent ae1a5a4 commit 5bdb1ac
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lxc/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,12 @@ func (g *cmdGlobal) cmpInstanceSetKeys(instanceName string) ([]string, cobra.She
configKeys := make([]string, 0, keyCount)

for configKey := range instance.Config {
// We only want to return the intersection between allInstanceConfigKeys and configKeys to avoid returning the full instance config.
// We only want to return the intersection between allInstanceConfigKeys
// and configKeys to avoid returning the full instance config.
// We also need to account for user defined keys such as user.* and linux.sysctl.*.
_, exists := keySet[configKey]
if exists {
if exists || strings.HasPrefix(configKey, "user.") ||
strings.HasPrefix(configKey, "linux.sysctl.") {
configKeys = append(configKeys, configKey)
}
}
Expand Down

0 comments on commit 5bdb1ac

Please sign in to comment.