newNodeCommand returns a cobra command for `node` subcommands
(dockerCLI command.Cli)
| 17 | |
| 18 | // newNodeCommand returns a cobra command for `node` subcommands |
| 19 | func 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 |
nothing calls this directly
no test coverage detected
searching dependent graphs…