mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #22208 from msabansal/staticip
Enabling specifying static ip for predefined network on windows
This commit is contained in:
commit
5632768a0f
3 changed files with 9 additions and 1 deletions
|
@ -511,7 +511,7 @@ func (daemon *Daemon) updateNetworkConfig(container *container.Container, idOrNa
|
||||||
}
|
}
|
||||||
|
|
||||||
if !containertypes.NetworkMode(idOrName).IsUserDefined() {
|
if !containertypes.NetworkMode(idOrName).IsUserDefined() {
|
||||||
if hasUserDefinedIPAddress(endpointConfig) {
|
if hasUserDefinedIPAddress(endpointConfig) && !enableIPOnPredefinedNetwork() {
|
||||||
return nil, runconfig.ErrUnsupportedNetworkAndIP
|
return nil, runconfig.ErrUnsupportedNetworkAndIP
|
||||||
}
|
}
|
||||||
if endpointConfig != nil && len(endpointConfig.Aliases) > 0 {
|
if endpointConfig != nil && len(endpointConfig.Aliases) > 0 {
|
||||||
|
|
|
@ -383,3 +383,7 @@ func isLinkable(child *container.Container) bool {
|
||||||
func errRemovalContainer(containerID string) error {
|
func errRemovalContainer(containerID string) error {
|
||||||
return fmt.Errorf("Container %s is marked for removal and cannot be connected or disconnected to the network", containerID)
|
return fmt.Errorf("Container %s is marked for removal and cannot be connected or disconnected to the network", containerID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func enableIPOnPredefinedNetwork() bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
|
@ -55,3 +55,7 @@ func killProcessDirectly(container *container.Container) error {
|
||||||
func isLinkable(child *container.Container) bool {
|
func isLinkable(child *container.Container) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func enableIPOnPredefinedNetwork() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue