Merge pull request #6317 from Benehiko/command/node
Unexport node commands
This commit is contained in:
@ -75,6 +75,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
|
||||
// orchestration (swarm) commands
|
||||
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
|
||||
config.NewConfigCommand(dockerCli),
|
||||
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
|
||||
node.NewNodeCommand(dockerCli),
|
||||
secret.NewSecretCommand(dockerCli),
|
||||
service.NewServiceCommand(dockerCli),
|
||||
|
||||
@ -12,25 +12,32 @@ import (
|
||||
)
|
||||
|
||||
// NewNodeCommand returns a cobra command for `node` subcommands
|
||||
func NewNodeCommand(dockerCli command.Cli) *cobra.Command {
|
||||
//
|
||||
// Deprecated: Do not import commands directly. They will be removed in a future release.
|
||||
func NewNodeCommand(dockerCLI command.Cli) *cobra.Command {
|
||||
return newNodeCommand(dockerCLI)
|
||||
}
|
||||
|
||||
// newNodeCommand returns a cobra command for `node` subcommands
|
||||
func newNodeCommand(dockerCLI command.Cli) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "node",
|
||||
Short: "Manage Swarm nodes",
|
||||
Args: cli.NoArgs,
|
||||
RunE: command.ShowHelp(dockerCli.Err()),
|
||||
RunE: command.ShowHelp(dockerCLI.Err()),
|
||||
Annotations: map[string]string{
|
||||
"version": "1.24",
|
||||
"swarm": "manager",
|
||||
},
|
||||
}
|
||||
cmd.AddCommand(
|
||||
newDemoteCommand(dockerCli),
|
||||
newInspectCommand(dockerCli),
|
||||
newListCommand(dockerCli),
|
||||
newPromoteCommand(dockerCli),
|
||||
newRemoveCommand(dockerCli),
|
||||
newPsCommand(dockerCli),
|
||||
newUpdateCommand(dockerCli),
|
||||
newDemoteCommand(dockerCLI),
|
||||
newInspectCommand(dockerCLI),
|
||||
newListCommand(dockerCLI),
|
||||
newPromoteCommand(dockerCLI),
|
||||
newRemoveCommand(dockerCLI),
|
||||
newPsCommand(dockerCLI),
|
||||
newUpdateCommand(dockerCLI),
|
||||
)
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user