From 4307f76a10d83d5e67d8be7161d35e9808b2d354 Mon Sep 17 00:00:00 2001 From: Kadin Sayani Date: Thu, 19 Dec 2024 12:23:35 -0700 Subject: [PATCH] lxc/completion: Fix `cmpInstanceSetKeys` to return set instance config keys Signed-off-by: Kadin Sayani --- lxc/completion.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lxc/completion.go b/lxc/completion.go index b0eeb9e33772..ed77d5bed999 100644 --- a/lxc/completion.go +++ b/lxc/completion.go @@ -359,8 +359,6 @@ func (g *cmdGlobal) cmpInstanceSetKeys(instanceName string) ([]string, cobra.She return nil, cobra.ShellCompDirectiveError } - instanceType := instance.Type - // Fetch all config keys that can be set by a user based on instance type. allInstanceConfigKeys, _ := g.cmpInstanceKeys(instanceName) @@ -378,11 +376,7 @@ func (g *cmdGlobal) cmpInstanceSetKeys(instanceName string) ([]string, cobra.She // We only want to return the intersection between allInstanceConfigKeys and configKeys to avoid returning the full instance config. _, exists := keySet[configKey] if exists { - if shared.StringHasPrefix(configKey, instancetype.ConfigKeyPrefixesAny...) { - configKeys = append(configKeys, configKey) - } else if instanceType == string(api.InstanceTypeContainer) && shared.StringHasPrefix(configKey, instancetype.ConfigKeyPrefixesContainer...) { - configKeys = append(configKeys, configKey) - } + configKeys = append(configKeys, configKey) } }