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

Function newPromoteCommand

cli/command/node/promote.go:13–24  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

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

Callers 4

TestNodePromoteErrorsFunction · 0.85
TestNodePromoteNoChangeFunction · 0.85
newNodeCommandFunction · 0.85

Calls 2

runPromoteFunction · 0.85
completeNodeNamesFunction · 0.85

Tested by 3

TestNodePromoteErrorsFunction · 0.68
TestNodePromoteNoChangeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…