runDeploy is the swarm implementation of docker stack deploy
(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet, opts *deployOptions, cfg *composetypes.Config)
| 79 | |
| 80 | // runDeploy is the swarm implementation of docker stack deploy |
| 81 | func runDeploy(ctx context.Context, dockerCLI command.Cli, flags *pflag.FlagSet, opts *deployOptions, cfg *composetypes.Config) error { |
| 82 | switch opts.resolveImage { |
| 83 | case resolveImageAlways, resolveImageChanged, resolveImageNever: |
| 84 | // valid options. |
| 85 | default: |
| 86 | return fmt.Errorf("invalid option %s for flag --resolve-image", opts.resolveImage) |
| 87 | } |
| 88 | |
| 89 | if opts.detach && !flags.Changed("detach") { |
| 90 | _, _ = fmt.Fprintln(dockerCLI.Err(), "Since --detach=false was not specified, tasks will be created in the background.\n"+ |
| 91 | "In a future release, --detach=false will become the default.") |
| 92 | } |
| 93 | |
| 94 | return deployCompose(ctx, dockerCLI, opts, cfg) |
| 95 | } |
| 96 | |
| 97 | // checkDaemonIsSwarmManager does an Info API call to verify that the daemon is |
| 98 | // a swarm manager. This is necessary because we must create networks before we |
no test coverage detected
searching dependent graphs…