Преглед на файлове

daemon: remove getPortMapInfo alias

The getPortMapInfo var was introduced in f198dfd856ca6125ef50b11d9d698550d66c9d4e,
and (from looking at that patch) looks to have been as a quick and dirty workaround
for the `container` argument colliding with the `container` import.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn преди 2 години
родител
ревизия
3564d03b0f
променени са 2 файла, в които са добавени 6 реда и са изтрити 9 реда
  1. 3 6
      daemon/container_operations.go
  2. 3 3
      daemon/network.go

+ 3 - 6
daemon/container_operations.go

@@ -26,12 +26,9 @@ import (
 	"github.com/sirupsen/logrus"
 )
 
-var (
-	// ErrRootFSReadOnly is returned when a container
-	// rootfs is marked readonly.
-	ErrRootFSReadOnly = errors.New("container rootfs is marked read-only")
-	getPortMapInfo    = getSandboxPortMapInfo
-)
+// ErrRootFSReadOnly is returned when a container
+// rootfs is marked readonly.
+var ErrRootFSReadOnly = errors.New("container rootfs is marked read-only")
 
 func (daemon *Daemon) getDNSSearchSettings(container *container.Container) []string {
 	if len(container.HostConfig.DNSSearch) > 0 {

+ 3 - 3
daemon/network.go

@@ -886,7 +886,7 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
 	}
 
 	// Port-mapping rules belong to the container & applicable only to non-internal networks
-	portmaps := getSandboxPortMapInfo(sb)
+	portmaps := getPortMapInfo(sb)
 	if n.Info().Internal() || len(portmaps) > 0 {
 		return createOptions, nil
 	}
@@ -960,8 +960,8 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
 	return createOptions, nil
 }
 
-// getSandboxPortMapInfo retrieves the current port-mapping programmed for the given sandbox
-func getSandboxPortMapInfo(sb libnetwork.Sandbox) nat.PortMap {
+// getPortMapInfo retrieves the current port-mapping programmed for the given sandbox
+func getPortMapInfo(sb libnetwork.Sandbox) nat.PortMap {
 	pm := nat.PortMap{}
 	if sb == nil {
 		return pm