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
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (container *Container) GetMountPoints() []types.MountPoint {
|
||||
mountPoints := make([]types.MountPoint, 0, len(container.MountPoints))
|
||||
|
|
|
@ -182,11 +182,6 @@ func (container *Container) BuildHostnameFile() error {
|
|||
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.
|
||||
func (container *Container) GetMountPoints() []types.MountPoint {
|
||||
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() {
|
||||
return runconfig.ErrUnsupportedNetworkAndIP
|
||||
}
|
||||
if endpointConfig != nil && len(endpointConfig.Aliases) > 0 && !container.EnableServiceDiscoveryOnDefaultNetwork() {
|
||||
if endpointConfig != nil && len(endpointConfig.Aliases) > 0 && !serviceDiscoveryOnDefaultNetwork() {
|
||||
return runconfig.ErrUnsupportedNetworkAndAlias
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -368,6 +368,11 @@ func enableIPOnPredefinedNetwork() bool {
|
|||
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 {
|
||||
var err error
|
||||
|
||||
|
|
|
@ -154,6 +154,11 @@ func enableIPOnPredefinedNetwork() bool {
|
|||
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 {
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -796,7 +796,7 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
|
|||
|
||||
defaultNetName := runconfig.DefaultDaemonNetworkMode().NetworkName()
|
||||
|
||||
if (!c.EnableServiceDiscoveryOnDefaultNetwork() && n.Name() == defaultNetName) ||
|
||||
if (!serviceDiscoveryOnDefaultNetwork() && n.Name() == defaultNetName) ||
|
||||
c.NetworkSettings.IsAnonymousEndpoint {
|
||||
createOptions = append(createOptions, libnetwork.CreateOptionAnonymous())
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue