Skip to content

Commit 2133d04

Browse files
committed
cli/command/context: remove deprecated k8s / orchestrator option-stubs
support for kubernetes contexts was deprecated in docker 20.10 through b639ea8, 0793f96, and 1d37fb3, and removed altoghether in 23.0 through 193ede9. This patch removes the remaining stubs for options that were deprecated and no longer used. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 3c99d22 commit 2133d04

3 files changed

Lines changed: 4 additions & 31 deletions

File tree

cli/command/context/create.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,7 @@ func newCreateCommand(dockerCli command.Cli) *cobra.Command {
5151
}
5252
flags := cmd.Flags()
5353
flags.StringVar(&opts.Description, "description", "", "Description of the context")
54-
flags.String(
55-
"default-stack-orchestrator", "",
56-
`Default orchestrator for stack operations to use with this context ("swarm", "kubernetes", "all")`,
57-
)
58-
flags.SetAnnotation("default-stack-orchestrator", "deprecated", nil)
59-
flags.SetAnnotation("default-stack-orchestrator", "deprecated", nil)
60-
flags.MarkDeprecated("default-stack-orchestrator", "option will be ignored")
6154
flags.StringToStringVar(&opts.Docker, "docker", nil, "set the docker endpoint")
62-
flags.StringToString("kubernetes", nil, "set the kubernetes endpoint")
63-
flags.SetAnnotation("kubernetes", "kubernetes", nil)
64-
flags.SetAnnotation("kubernetes", "deprecated", nil)
65-
flags.MarkDeprecated("kubernetes", "option will be ignored")
6655
flags.StringVar(&opts.From, "from", "", "create context from a named context")
6756
return cmd
6857
}

cli/command/context/export.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ type ExportOptions struct {
1919
}
2020

2121
func newExportCommand(dockerCli command.Cli) *cobra.Command {
22-
opts := &ExportOptions{}
23-
cmd := &cobra.Command{
22+
return &cobra.Command{
2423
Use: "export [OPTIONS] CONTEXT [FILE|-]",
2524
Short: "Export a context to a tar archive FILE or a tar stream on STDOUT.",
2625
Args: cli.RequiresRangeArgs(1, 2),
2726
RunE: func(cmd *cobra.Command, args []string) error {
28-
opts.ContextName = args[0]
27+
opts := &ExportOptions{
28+
ContextName: args[0],
29+
}
2930
if len(args) == 2 {
3031
opts.Dest = args[1]
3132
} else {
@@ -34,13 +35,6 @@ func newExportCommand(dockerCli command.Cli) *cobra.Command {
3435
return RunExport(dockerCli, opts)
3536
},
3637
}
37-
38-
flags := cmd.Flags()
39-
flags.Bool("kubeconfig", false, "Export as a kubeconfig file")
40-
flags.MarkDeprecated("kubeconfig", "option will be ignored")
41-
flags.SetAnnotation("kubeconfig", "kubernetes", nil)
42-
flags.SetAnnotation("kubeconfig", "deprecated", nil)
43-
return cmd
4438
}
4539

4640
func writeTo(dockerCli command.Cli, reader io.Reader, dest string) error {

cli/command/context/update.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,7 @@ func newUpdateCommand(dockerCli command.Cli) *cobra.Command {
4747
}
4848
flags := cmd.Flags()
4949
flags.StringVar(&opts.Description, "description", "", "Description of the context")
50-
flags.String(
51-
"default-stack-orchestrator", "",
52-
"Default orchestrator for stack operations to use with this context (swarm|kubernetes|all)",
53-
)
54-
flags.SetAnnotation("default-stack-orchestrator", "deprecated", nil)
55-
flags.MarkDeprecated("default-stack-orchestrator", "option will be ignored")
5650
flags.StringToStringVar(&opts.Docker, "docker", nil, "set the docker endpoint")
57-
flags.StringToString("kubernetes", nil, "set the kubernetes endpoint")
58-
flags.SetAnnotation("kubernetes", "kubernetes", nil)
59-
flags.SetAnnotation("kubernetes", "deprecated", nil)
60-
flags.MarkDeprecated("kubernetes", "option will be ignored")
6151
return cmd
6252
}
6353

0 commit comments

Comments
 (0)