diff --git a/daemon/container_operations.go b/daemon/container_operations.go index 909c7ccb275c6564456b8d9c87a4e7f62daa7d68..dcf83a34a5cf19d79bdebae22a45a0aeff89d210 100644 --- a/daemon/container_operations.go +++ b/daemon/container_operations.go @@ -6,7 +6,6 @@ import ( "net" "os" "path" - "runtime" "strings" "time" @@ -1040,8 +1039,6 @@ func (daemon *Daemon) ConnectToNetwork(container *container.Container, idOrName EndpointSettings: endpointConfig, } } - } else if !daemon.isNetworkHotPluggable() { - return fmt.Errorf(runtime.GOOS + " does not support connecting a running container to a network") } else { if err := daemon.connectToNetwork(container, idOrName, endpointConfig, true); err != nil { return err @@ -1070,8 +1067,6 @@ func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, netw return fmt.Errorf("container %s is not connected to the network %s", container.ID, networkName) } delete(container.NetworkSettings.Networks, networkName) - } else if err == nil && !daemon.isNetworkHotPluggable() { - return fmt.Errorf(runtime.GOOS + " does not support connecting a running container to a network") } else if err == nil { if container.HostConfig.NetworkMode.IsHost() && containertypes.NetworkMode(n.Type()).IsHost() { return runconfig.ErrConflictHostNetwork diff --git a/daemon/container_operations_unix.go b/daemon/container_operations_unix.go index 0d74158bb2d03cd751b1e6023a55d15da477f1fa..2a5da473b7f0655ec846c35b89523bd35fd13721 100644 --- a/daemon/container_operations_unix.go +++ b/daemon/container_operations_unix.go @@ -368,10 +368,6 @@ func enableIPOnPredefinedNetwork() bool { return false } -func (daemon *Daemon) isNetworkHotPluggable() bool { - return true -} - func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error { var err error diff --git a/daemon/container_operations_windows.go b/daemon/container_operations_windows.go index c2381e643110421fd305368e7e0f600c13fadfdd..3dbf53ef5be7aa36128c6dbed2f7f721e671b4e5 100644 --- a/daemon/container_operations_windows.go +++ b/daemon/container_operations_windows.go @@ -154,10 +154,6 @@ func enableIPOnPredefinedNetwork() bool { return true } -func (daemon *Daemon) isNetworkHotPluggable() bool { - return true -} - func (daemon *Daemon) setupPathsAndSandboxOptions(container *container.Container, sboxOptions *[]libnetwork.SandboxOption) error { return nil }