diff --git a/daemon/container_operations.go b/daemon/container_operations.go index 909c7ccb27..dcf83a34a5 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 0d74158bb2..2a5da473b7 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 c2381e6431..3dbf53ef5b 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 }