Add integration test for stack deploy.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
This commit is contained in:
Daniel Nephin 2016-11-04 14:55:24 -06:00
parent 3875355a3e
commit d05510d954
1 changed files with 7 additions and 2 deletions

View File

@ -19,8 +19,8 @@ import (
"github.com/docker/docker/cli"
"github.com/docker/docker/cli/command"
servicecmd "github.com/docker/docker/cli/command/service"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/docker/opts"
runconfigopts "github.com/docker/docker/runconfig/opts"
"github.com/docker/go-connections/nat"
)
@ -85,7 +85,12 @@ func runDeploy(dockerCli *command.DockerCli, opts deployOptions) error {
ctx := context.Background()
namespace := namespace{name: opts.namespace}
if err := createNetworks(ctx, dockerCli, config.Networks, namespace); err != nil {
networks := config.Networks
if networks == nil {
networks = make(map[string]composetypes.NetworkConfig)
}
if err := createNetworks(ctx, dockerCli, networks, namespace); err != nil {
return err
}
return deployServices(ctx, dockerCli, config, namespace, opts.sendRegistryAuth)