This patch deprecates exported image commands and moves the implementation details to an unexported function. Commands that are affected include: - image.NewBuildCommand - image.NewPullCommand - image.NewPushCommand - image.NewImagesCommand - image.NewImageCommand - image.NewHistoryCommand - image.NewImportCommand - image.NewLoadCommand - image.NewRemoveCommand - image.NewSaveCommand - image.NewTagCommand - image.NewPruneCommand Signed-off-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
40 lines
1.0 KiB
Go
40 lines
1.0 KiB
Go
package image
|
|
|
|
import (
|
|
"github.com/docker/cli/cli"
|
|
"github.com/docker/cli/cli/command"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// NewImageCommand returns a cobra command for `image` subcommands
|
|
//
|
|
// Deprecated: Do not import commands directly. They will be removed in a future release.
|
|
func NewImageCommand(dockerCLI command.Cli) *cobra.Command {
|
|
return newImageCommand(dockerCLI)
|
|
}
|
|
|
|
// newImageCommand returns a cobra command for `image` subcommands
|
|
func newImageCommand(dockerCli command.Cli) *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "image",
|
|
Short: "Manage images",
|
|
Args: cli.NoArgs,
|
|
RunE: command.ShowHelp(dockerCli.Err()),
|
|
}
|
|
cmd.AddCommand(
|
|
newBuildCommand(dockerCli),
|
|
newHistoryCommand(dockerCli),
|
|
newImportCommand(dockerCli),
|
|
newLoadCommand(dockerCli),
|
|
newPullCommand(dockerCli),
|
|
newPushCommand(dockerCli),
|
|
newSaveCommand(dockerCli),
|
|
newTagCommand(dockerCli),
|
|
newListCommand(dockerCli),
|
|
newImageRemoveCommand(dockerCli),
|
|
newInspectCommand(dockerCli),
|
|
newPruneCommand(dockerCli),
|
|
)
|
|
return cmd
|
|
}
|