Skip to content

Commit ae3ee9b

Browse files
BenehikothaJeztah
authored andcommitted
Unexport plugin commands
This patch deprecates exported plugin commands and moves the implementation details to an unexported function. Commands that are affected include: - plugin.NewPluginCommand Signed-off-by: Alano Terblanche <[email protected]> (cherry picked from commit c6b7268) Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 733762a commit ae3ee9b

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

cli/command/commands/commands.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func AddCommands(cmd *cobra.Command, dockerCli command.Cli) {
7171
manifest.NewManifestCommand(dockerCli),
7272
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7373
network.NewNetworkCommand(dockerCli),
74+
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7475
plugin.NewPluginCommand(dockerCli),
7576
//nolint:staticcheck // TODO: Remove when migration to cli/internal/commands.Register is complete. (see #6283)
7677
system.NewSystemCommand(dockerCli),

cli/command/plugin/cmd.go

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

99
// NewPluginCommand returns a cobra command for `plugin` subcommands
10-
func NewPluginCommand(dockerCli command.Cli) *cobra.Command {
10+
//
11+
// Deprecated: Do not import commands directly. They will be removed in a future release.
12+
func NewPluginCommand(dockerCLI command.Cli) *cobra.Command {
13+
return newPluginCommand(dockerCLI)
14+
}
15+
16+
// newPluginCommand returns a cobra command for `plugin` subcommands
17+
func newPluginCommand(dockerCLI command.Cli) *cobra.Command {
1118
cmd := &cobra.Command{
1219
Use: "plugin",
1320
Short: "Manage plugins",
1421
Args: cli.NoArgs,
15-
RunE: command.ShowHelp(dockerCli.Err()),
22+
RunE: command.ShowHelp(dockerCLI.Err()),
1623
Annotations: map[string]string{"version": "1.25"},
1724
}
1825

1926
cmd.AddCommand(
20-
newDisableCommand(dockerCli),
21-
newEnableCommand(dockerCli),
22-
newInspectCommand(dockerCli),
23-
newInstallCommand(dockerCli),
24-
newListCommand(dockerCli),
25-
newRemoveCommand(dockerCli),
26-
newSetCommand(dockerCli),
27-
newPushCommand(dockerCli),
28-
newCreateCommand(dockerCli),
29-
newUpgradeCommand(dockerCli),
27+
newDisableCommand(dockerCLI),
28+
newEnableCommand(dockerCLI),
29+
newInspectCommand(dockerCLI),
30+
newInstallCommand(dockerCLI),
31+
newListCommand(dockerCLI),
32+
newRemoveCommand(dockerCLI),
33+
newSetCommand(dockerCLI),
34+
newPushCommand(dockerCLI),
35+
newCreateCommand(dockerCLI),
36+
newUpgradeCommand(dockerCLI),
3037
)
3138
return cmd
3239
}

0 commit comments

Comments
 (0)