Skip to content

Commit 6c1dd75

Browse files
committed
Unexport config command
This patch unexports the `config` command. Signed-off-by: Alano Terblanche <[email protected]>
1 parent c06074b commit 6c1dd75

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

cli/command/config/cmd.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,38 @@ import (
44
"github.com/docker/cli/cli"
55
"github.com/docker/cli/cli/command"
66
"github.com/docker/cli/cli/command/completion"
7+
"github.com/docker/cli/internal/commands"
78
"github.com/moby/moby/api/types/swarm"
89
"github.com/spf13/cobra"
910
)
1011

12+
func init() {
13+
commands.RegisterCommand(newConfigCommand)
14+
}
15+
1116
// NewConfigCommand returns a cobra command for `config` subcommands
12-
func NewConfigCommand(dockerCli command.Cli) *cobra.Command {
17+
//
18+
// Deprecated: Do not import commands directly. They will be removed in a future release.
19+
func NewConfigCommand(dockerCLI command.Cli) *cobra.Command {
20+
return newConfigCommand(dockerCLI)
21+
}
22+
23+
func newConfigCommand(dockerCLI command.Cli) *cobra.Command {
1324
cmd := &cobra.Command{
1425
Use: "config",
1526
Short: "Manage Swarm configs",
1627
Args: cli.NoArgs,
17-
RunE: command.ShowHelp(dockerCli.Err()),
28+
RunE: command.ShowHelp(dockerCLI.Err()),
1829
Annotations: map[string]string{
1930
"version": "1.30",
2031
"swarm": "manager",
2132
},
2233
}
2334
cmd.AddCommand(
24-
newConfigListCommand(dockerCli),
25-
newConfigCreateCommand(dockerCli),
26-
newConfigInspectCommand(dockerCli),
27-
newConfigRemoveCommand(dockerCli),
35+
newConfigListCommand(dockerCLI),
36+
newConfigCreateCommand(dockerCLI),
37+
newConfigInspectCommand(dockerCLI),
38+
newConfigRemoveCommand(dockerCLI),
2839
)
2940
return cmd
3041
}

0 commit comments

Comments
 (0)