mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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 <vincent@sbr.pm>
This commit is contained in:
parent
1dded0dee4
commit
19cf2b3d5f
1 changed files with 3 additions and 4 deletions
|
@ -9,9 +9,6 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/spf13/cobra"
|
|
||||||
"golang.org/x/net/context"
|
|
||||||
|
|
||||||
"github.com/aanand/compose-file/loader"
|
"github.com/aanand/compose-file/loader"
|
||||||
composetypes "github.com/aanand/compose-file/types"
|
composetypes "github.com/aanand/compose-file/types"
|
||||||
"github.com/docker/docker/api/types"
|
"github.com/docker/docker/api/types"
|
||||||
|
@ -25,6 +22,8 @@ import (
|
||||||
"github.com/docker/docker/opts"
|
"github.com/docker/docker/opts"
|
||||||
runconfigopts "github.com/docker/docker/runconfig/opts"
|
runconfigopts "github.com/docker/docker/runconfig/opts"
|
||||||
"github.com/docker/go-connections/nat"
|
"github.com/docker/go-connections/nat"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -310,7 +309,7 @@ func convertServiceNetworks(
|
||||||
}
|
}
|
||||||
target := namespace.scope(networkName)
|
target := namespace.scope(networkName)
|
||||||
if networkConfig.External.External {
|
if networkConfig.External.External {
|
||||||
target = networkName
|
target = networkConfig.External.Name
|
||||||
}
|
}
|
||||||
nets = append(nets, swarm.NetworkAttachmentConfig{
|
nets = append(nets, swarm.NetworkAttachmentConfig{
|
||||||
Target: target,
|
Target: target,
|
||||||
|
|
Loading…
Add table
Reference in a new issue