1
0
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:
Alano Terblanche
2025-08-20 12:45:11 +02:00
parent 4643b42e1d
commit e00762ed7d
2 changed files with 13 additions and 6 deletions

View File

@@ -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),

View File

@@ -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
}