MCPcopy Index your code
hub / github.com/docker/cli / newPushCommand

Function newPushCommand

cli/command/plugin/push.go:15–33  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

13)
14
15func newPushCommand(dockerCLI command.Cli) *cobra.Command {
16 cmd := &cobra.Command{
17 Use: "push [OPTIONS] PLUGIN[:TAG]",
18 Short: "Push a plugin to a registry",
19 Args: cli.ExactArgs(1),
20 RunE: func(cmd *cobra.Command, args []string) error {
21 name := args[0]
22 return runPush(cmd.Context(), dockerCLI, name)
23 },
24 ValidArgsFunction: completeNames(dockerCLI, stateAny),
25 DisableFlagsInUseLine: true,
26 }
27
28 flags := cmd.Flags()
29 // TODO(thaJeztah): DEPRECATED: remove in v29.1 or v30
30 flags.Bool("disable-content-trust", true, "Skip image verification (deprecated)")
31 _ = flags.MarkDeprecated("disable-content-trust", "support for docker content trust was removed")
32 return cmd
33}
34
35func runPush(ctx context.Context, dockerCli command.Cli, name string) error {
36 named, err := reference.ParseNormalizedNamed(name)

Callers 1

newPluginCommandFunction · 0.70

Calls 2

runPushFunction · 0.70
completeNamesFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…