Skip to content

Commit ce242b0

Browse files
BenehikothaJeztah
authored andcommitted
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]> (cherry picked from commit bd8e3e4) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent ae3ee9b commit ce242b0

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
@@ -75,6 +75,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
7575
plugin.NewPluginCommand(dockerCli),
7676
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7777
system.NewSystemCommand(dockerCli),
78+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7879
trust.NewTrustCommand(dockerCli),
7980
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
8081
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)