(dockerCLI command.Cli)
| 13 | ) |
| 14 | |
| 15 | func 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 | |
| 35 | func runPush(ctx context.Context, dockerCli command.Cli, name string) error { |
| 36 | named, err := reference.ParseNormalizedNamed(name) |
no test coverage detected
searching dependent graphs…