Skip to content

Commit

Permalink
lxc/completion: Update instance completions to not show server configs (
Browse files Browse the repository at this point in the history
#14193)

Fixes #14189
  • Loading branch information
tomponline authored Oct 3, 2024
2 parents d7392ca + 0c3e893 commit 62a97d6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lxc/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ func (g *cmdGlobal) cmpInstanceAllKeys(instanceName string) ([]string, cobra.She
var keys []string
cmpDirectives := cobra.ShellCompDirectiveNoFileComp

_, instanceNameOnly, _ := strings.Cut(instanceName, ":")
if instanceNameOnly == "" {
_, instanceNameOnly, found := strings.Cut(instanceName, ":")
if instanceNameOnly == "" && found {
serverKeys, directives := g.cmpServerAllKeys(instanceName)
keys = append(keys, serverKeys...)
cmpDirectives = directives
Expand All @@ -231,7 +231,7 @@ func (g *cmdGlobal) cmpInstanceAllKeys(instanceName string) ([]string, cobra.She
resource := resources[0]
client := resource.server

instance, _, err := client.GetInstance(instanceNameOnly)
instance, _, err := client.GetInstance(instanceName)
if err != nil {
return nil, cobra.ShellCompDirectiveError
}
Expand Down

0 comments on commit 62a97d6

Please sign in to comment.