mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Move EnableServiceDiscoveryOnDefaultNetwork to container-operations
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
0169ad3e2a
commit
20dde01848
6 changed files with 12 additions and 12 deletions
|
@ -444,11 +444,6 @@ func (container *Container) TmpfsMounts() ([]Mount, error) {
|
||||||
return mounts, nil
|
return mounts, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableServiceDiscoveryOnDefaultNetwork Enable service discovery on default network
|
|
||||||
func (container *Container) EnableServiceDiscoveryOnDefaultNetwork() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock.
|
// GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock.
|
||||||
func (container *Container) GetMountPoints() []types.MountPoint {
|
func (container *Container) GetMountPoints() []types.MountPoint {
|
||||||
mountPoints := make([]types.MountPoint, 0, len(container.MountPoints))
|
mountPoints := make([]types.MountPoint, 0, len(container.MountPoints))
|
||||||
|
|
|
@ -182,11 +182,6 @@ func (container *Container) BuildHostnameFile() error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// EnableServiceDiscoveryOnDefaultNetwork Enable service discovery on default network
|
|
||||||
func (container *Container) EnableServiceDiscoveryOnDefaultNetwork() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock.
|
// GetMountPoints gives a platform specific transformation to types.MountPoint. Callers must hold a Container lock.
|
||||||
func (container *Container) GetMountPoints() []types.MountPoint {
|
func (container *Container) GetMountPoints() []types.MountPoint {
|
||||||
mountPoints := make([]types.MountPoint, 0, len(container.MountPoints))
|
mountPoints := make([]types.MountPoint, 0, len(container.MountPoints))
|
||||||
|
|
|
@ -657,7 +657,7 @@ func (daemon *Daemon) updateNetworkConfig(container *container.Container, n libn
|
||||||
if hasUserDefinedIPAddress(endpointConfig) && !enableIPOnPredefinedNetwork() {
|
if hasUserDefinedIPAddress(endpointConfig) && !enableIPOnPredefinedNetwork() {
|
||||||
return runconfig.ErrUnsupportedNetworkAndIP
|
return runconfig.ErrUnsupportedNetworkAndIP
|
||||||
}
|
}
|
||||||
if endpointConfig != nil && len(endpointConfig.Aliases) > 0 && !container.EnableServiceDiscoveryOnDefaultNetwork() {
|
if endpointConfig != nil && len(endpointConfig.Aliases) > 0 && !serviceDiscoveryOnDefaultNetwork() {
|
||||||
return runconfig.ErrUnsupportedNetworkAndAlias
|
return runconfig.ErrUnsupportedNetworkAndAlias
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -368,6 +368,11 @@ func enableIPOnPredefinedNetwork() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// serviceDiscoveryOnDefaultNetwork indicates if service discovery is supported on the default network
|
||||||
|
func serviceDiscoveryOnDefaultNetwork() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error {
|
func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
|
|
@ -154,6 +154,11 @@ func enableIPOnPredefinedNetwork() bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// serviceDiscoveryOnDefaultNetwork indicates if service discovery is supported on the default network
|
||||||
|
func serviceDiscoveryOnDefaultNetwork() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error {
|
func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -796,7 +796,7 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
|
||||||
|
|
||||||
defaultNetName := runconfig.DefaultDaemonNetworkMode().NetworkName()
|
defaultNetName := runconfig.DefaultDaemonNetworkMode().NetworkName()
|
||||||
|
|
||||||
if (!c.EnableServiceDiscoveryOnDefaultNetwork() && n.Name() == defaultNetName) ||
|
if (!serviceDiscoveryOnDefaultNetwork() && n.Name() == defaultNetName) ||
|
||||||
c.NetworkSettings.IsAnonymousEndpoint {
|
c.NetworkSettings.IsAnonymousEndpoint {
|
||||||
createOptions = append(createOptions, libnetwork.CreateOptionAnonymous())
|
createOptions = append(createOptions, libnetwork.CreateOptionAnonymous())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue