From 19cf2b3d5fe62aa62b022311b750af37350aaf35 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Mon, 9 Jan 2017 11:58:06 +0100 Subject: [PATCH] Fix external network name not properly handle by stack deploy Make sure we use the Network external name if it's not empty. Signed-off-by: Vincent Demeester --- cli/command/stack/deploy.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cli/command/stack/deploy.go b/cli/command/stack/deploy.go index 8a18cff43a..9ff9074f59 100644 --- a/cli/command/stack/deploy.go +++ b/cli/command/stack/deploy.go @@ -9,9 +9,6 @@ import ( "strings" "time" - "github.com/spf13/cobra" - "golang.org/x/net/context" - "github.com/aanand/compose-file/loader" composetypes "github.com/aanand/compose-file/types" "github.com/docker/docker/api/types" @@ -25,6 +22,8 @@ import ( "github.com/docker/docker/opts" runconfigopts "github.com/docker/docker/runconfig/opts" "github.com/docker/go-connections/nat" + "github.com/spf13/cobra" + "golang.org/x/net/context" ) const ( @@ -310,7 +309,7 @@ func convertServiceNetworks( } target := namespace.scope(networkName) if networkConfig.External.External { - target = networkName + target = networkConfig.External.Name } nets = append(nets, swarm.NetworkAttachmentConfig{ Target: target,