Use constants in completion of IPCModes

Signed-off-by: Harald Albers <github@albersweb.de>
This commit is contained in:
Harald Albers 2024-10-30 17:18:10 +00:00
parent a40ea78579
commit 3bc177b8ac
1 changed files with 7 additions and 1 deletions

View File

@ -216,7 +216,13 @@ func completeIpc(dockerCLI completion.APIClientProvider) func(cmd *cobra.Command
names, _ := completion.ContainerNames(dockerCLI, true)(cmd, args, toComplete)
return prefixWith("container:", names), cobra.ShellCompDirectiveNoFileComp
}
return []string{"container:", "host", "none", "private", "shareable"}, cobra.ShellCompDirectiveNoFileComp
return []string{
string(container.IPCModeContainer + ":"),
string(container.IPCModeHost),
string(container.IPCModeNone),
string(container.IPCModePrivate),
string(container.IPCModeShareable),
}, cobra.ShellCompDirectiveNoFileComp
}
}