From 3bc177b8ac1c9eeb0ff3147af5b7754f00792e03 Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Wed, 30 Oct 2024 17:18:10 +0000 Subject: [PATCH] Use constants in completion of IPCModes Signed-off-by: Harald Albers --- cli/command/container/completion.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/command/container/completion.go b/cli/command/container/completion.go index 94e9b50461..34456d40ee 100644 --- a/cli/command/container/completion.go +++ b/cli/command/container/completion.go @@ -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 } }