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

Function newNodeCommand

cli/command/node/cmd.go:19–41  ·  view source on GitHub ↗

newNodeCommand returns a cobra command for `node` subcommands

(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

17
18// newNodeCommand returns a cobra command for `node` subcommands
19func newNodeCommand(dockerCLI command.Cli) *cobra.Command {
20 cmd := &cobra.Command{
21 Use: "node",
22 Short: "Manage Swarm nodes",
23 Args: cli.NoArgs,
24 RunE: command.ShowHelp(dockerCLI.Err()),
25 Annotations: map[string]string{
26 "version": "1.24",
27 "swarm": "manager",
28 },
29 DisableFlagsInUseLine: true,
30 }
31 cmd.AddCommand(
32 newDemoteCommand(dockerCLI),
33 newInspectCommand(dockerCLI),
34 newListCommand(dockerCLI),
35 newPromoteCommand(dockerCLI),
36 newRemoveCommand(dockerCLI),
37 newPsCommand(dockerCLI),
38 newUpdateCommand(dockerCLI),
39 )
40 return cmd
41}
42
43// Reference returns the reference of a node. The special value "self" for a node
44// reference is mapped to the current node, hence the node ID is retrieved using

Callers

nothing calls this directly

Calls 8

newDemoteCommandFunction · 0.85
newPromoteCommandFunction · 0.85
newInspectCommandFunction · 0.70
newListCommandFunction · 0.70
newRemoveCommandFunction · 0.70
newPsCommandFunction · 0.70
newUpdateCommandFunction · 0.70
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…