Skip to content

Commit bd8e3e4

Browse files
committed
Unexport trust commands
This patch deprecates exported trust commands and moves the implementation details to an unexported function. Commands that are affected include: - trust.NewTrustCommand Signed-off-by: Alano Terblanche <[email protected]>
1 parent b2b7187 commit bd8e3e4

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

cli/command/commands/commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
7474
plugin.NewPluginCommand(dockerCli),
7575
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7676
system.NewSystemCommand(dockerCli),
77+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7778
trust.NewTrustCommand(dockerCli),
7879
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7980
volume.NewVolumeCommand(dockerCli),

cli/command/trust/cmd.go

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,25 @@ import (
77
)
88

99
// NewTrustCommand returns a cobra command for `trust` subcommands
10-
func NewTrustCommand(dockerCli command.Cli) *cobra.Command {
10+
//
11+
// Deprecated: Do not import commands directly. They will be removed in a future release.
12+
func NewTrustCommand(dockerCLI command.Cli) *cobra.Command {
13+
return newTrustCommand(dockerCLI)
14+
}
15+
16+
func newTrustCommand(dockerCLI command.Cli) *cobra.Command {
1117
cmd := &cobra.Command{
1218
Use: "trust",
1319
Short: "Manage trust on Docker images",
1420
Args: cli.NoArgs,
15-
RunE: command.ShowHelp(dockerCli.Err()),
21+
RunE: command.ShowHelp(dockerCLI.Err()),
1622
}
1723
cmd.AddCommand(
18-
newRevokeCommand(dockerCli),
19-
newSignCommand(dockerCli),
20-
newTrustKeyCommand(dockerCli),
21-
newTrustSignerCommand(dockerCli),
22-
newInspectCommand(dockerCli),
24+
newRevokeCommand(dockerCLI),
25+
newSignCommand(dockerCLI),
26+
newTrustKeyCommand(dockerCLI),
27+
newTrustSignerCommand(dockerCLI),
28+
newInspectCommand(dockerCLI),
2329
)
2430
return cmd
2531
}

0 commit comments

Comments
 (0)