daemon: remove getPortMapInfo alias

The getPortMapInfo var was introduced in f198dfd856,
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>
This commit is contained in:
Sebastiaan van Stijn 2022-09-26 20:41:46 +02:00
parent 0dde471278
commit 3564d03b0f
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
2 changed files with 6 additions and 9 deletions

View file

@ -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 {

View file

@ -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