(dockerCLI command.Cli)
| 11 | ) |
| 12 | |
| 13 | func newDemoteCommand(dockerCLI command.Cli) *cobra.Command { |
| 14 | return &cobra.Command{ |
| 15 | Use: "demote NODE [NODE...]", |
| 16 | Short: "Demote one or more nodes from manager in the swarm", |
| 17 | Args: cli.RequiresMinArgs(1), |
| 18 | RunE: func(cmd *cobra.Command, args []string) error { |
| 19 | return runDemote(cmd.Context(), dockerCLI, args) |
| 20 | }, |
| 21 | ValidArgsFunction: completeNodeNames(dockerCLI), |
| 22 | DisableFlagsInUseLine: true, |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | func runDemote(ctx context.Context, dockerCLI command.Cli, nodes []string) error { |
| 27 | demote := func(node *swarm.Node) error { |
searching dependent graphs…