summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/bindings/test/containers_test.go1
-rw-r--r--pkg/specgen/generate/ports.go15
2 files changed, 9 insertions, 7 deletions
diff --git a/pkg/bindings/test/containers_test.go b/pkg/bindings/test/containers_test.go
index c1a01c280..9a188e5da 100644
--- a/pkg/bindings/test/containers_test.go
+++ b/pkg/bindings/test/containers_test.go
@@ -280,6 +280,7 @@ var _ = Describe("Podman containers ", func() {
})
It("podman wait to pause|unpause condition", func() {
+ Skip("FIXME: https://github.com/containers/podman/issues/6518")
var (
name = "top"
exitCode int32 = -1
diff --git a/pkg/specgen/generate/ports.go b/pkg/specgen/generate/ports.go
index 1ad7e6f4d..7dd50ac0d 100644
--- a/pkg/specgen/generate/ports.go
+++ b/pkg/specgen/generate/ports.go
@@ -123,19 +123,20 @@ func parsePortMapping(portMappings []specgen.PortMapping) ([]ocicni.PortMapping,
postAssignHostPort = true
}
} else {
- testCPort := ctrPortMap[cPort]
- if testCPort != 0 && testCPort != hPort {
- // This is an attempt to redefine a port
- return nil, nil, nil, errors.Errorf("conflicting port mappings for container port %d (protocol %s)", cPort, p)
- }
- ctrPortMap[cPort] = hPort
-
testHPort := hostPortMap[hPort]
if testHPort != 0 && testHPort != cPort {
return nil, nil, nil, errors.Errorf("conflicting port mappings for host port %d (protocol %s)", hPort, p)
}
hostPortMap[hPort] = cPort
+ // Mapping a container port to multiple
+ // host ports is allowed.
+ // We only store the latest of these in
+ // the container port map - we don't
+ // need to know all of them, just one.
+ testCPort := ctrPortMap[cPort]
+ ctrPortMap[cPort] = hPort
+
// If we have an exact duplicate, just continue
if testCPort == hPort && testHPort == cPort {
continue