mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Unexport secret commands
This patch deprecates exported secret commands and moves the implementation details to an unexported function. Commands that are affected include: - secrets.NewSecretCommand Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
This commit is contained in:
@@ -75,6 +75,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
|
||||
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
|
||||
config.NewConfigCommand(dockerCli),
|
||||
node.NewNodeCommand(dockerCli),
|
||||
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
|
||||
secret.NewSecretCommand(dockerCli),
|
||||
service.NewServiceCommand(dockerCli),
|
||||
stack.NewStackCommand(dockerCli),
|
||||
|
||||
@@ -9,22 +9,28 @@ import (
|
||||
)
|
||||
|
||||
// NewSecretCommand returns a cobra command for `secret` subcommands
|
||||
func NewSecretCommand(dockerCli command.Cli) *cobra.Command {
|
||||
//
|
||||
// Deprecated: Do not import commands directly. They will be removed in a future release.
|
||||
func NewSecretCommand(dockerCLI command.Cli) *cobra.Command {
|
||||
return newSecretCommand(dockerCLI)
|
||||
}
|
||||
|
||||
func newSecretCommand(dockerCLI command.Cli) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "secret",
|
||||
Short: "Manage Swarm secrets",
|
||||
Args: cli.NoArgs,
|
||||
RunE: command.ShowHelp(dockerCli.Err()),
|
||||
RunE: command.ShowHelp(dockerCLI.Err()),
|
||||
Annotations: map[string]string{
|
||||
"version": "1.25",
|
||||
"swarm": "manager",
|
||||
},
|
||||
}
|
||||
cmd.AddCommand(
|
||||
newSecretListCommand(dockerCli),
|
||||
newSecretCreateCommand(dockerCli),
|
||||
newSecretInspectCommand(dockerCli),
|
||||
newSecretRemoveCommand(dockerCli),
|
||||
newSecretListCommand(dockerCLI),
|
||||
newSecretCreateCommand(dockerCLI),
|
||||
newSecretInspectCommand(dockerCLI),
|
||||
newSecretRemoveCommand(dockerCLI),
|
||||
)
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user