Skip to content

Commit 4c3fa4a

Browse files
authored
Merge pull request #6286 from Benehiko/commands/config
Unexport config command
2 parents 6ad1d46 + cce29da commit 4c3fa4a

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

cli/command/commands/commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
6060
volume.NewVolumeCommand(dockerCli),
6161

6262
// orchestration (swarm) commands
63+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
6364
config.NewConfigCommand(dockerCli),
6465
node.NewNodeCommand(dockerCli),
6566
secret.NewSecretCommand(dockerCli),

cli/command/config/cmd.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,28 @@ import (
99
)
1010

1111
// NewConfigCommand returns a cobra command for `config` subcommands
12-
func NewConfigCommand(dockerCli command.Cli) *cobra.Command {
12+
//
13+
// Deprecated: Do not import commands directly. They will be removed in a future release.
14+
func NewConfigCommand(dockerCLI command.Cli) *cobra.Command {
15+
return newConfigCommand(dockerCLI)
16+
}
17+
18+
func newConfigCommand(dockerCLI command.Cli) *cobra.Command {
1319
cmd := &cobra.Command{
1420
Use: "config",
1521
Short: "Manage Swarm configs",
1622
Args: cli.NoArgs,
17-
RunE: command.ShowHelp(dockerCli.Err()),
23+
RunE: command.ShowHelp(dockerCLI.Err()),
1824
Annotations: map[string]string{
1925
"version": "1.30",
2026
"swarm": "manager",
2127
},
2228
}
2329
cmd.AddCommand(
24-
newConfigListCommand(dockerCli),
25-
newConfigCreateCommand(dockerCli),
26-
newConfigInspectCommand(dockerCli),
27-
newConfigRemoveCommand(dockerCli),
30+
newConfigListCommand(dockerCLI),
31+
newConfigCreateCommand(dockerCLI),
32+
newConfigInspectCommand(dockerCLI),
33+
newConfigRemoveCommand(dockerCLI),
2834
)
2935
return cmd
3036
}

0 commit comments

Comments
 (0)