summaryrefslogtreecommitdiff
path: root/pkg/spec
diff options
context:
space:
mode:
authorKunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>2018-08-23 14:50:38 +0900
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-24 14:31:38 +0000
commitaf9f83f11c9b92ea806b33b75337de7e5d93592d (patch)
tree042bf7901ef33c4464981f29b919222473fb9282 /pkg/spec
parentf1b4f43d7521c33551669d7f889012fcba4ec926 (diff)
downloadpodman-af9f83f11c9b92ea806b33b75337de7e5d93592d.tar.gz
podman-af9f83f11c9b92ea806b33b75337de7e5d93592d.tar.bz2
podman-af9f83f11c9b92ea806b33b75337de7e5d93592d.zip
exposes tcp port only if no proto specified.
Also it fix the issue of exposing both tc/udp port even if only one proto specified. Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp> Closes: #1325 Approved by: mheon
Diffstat (limited to 'pkg/spec')
-rw-r--r--pkg/spec/createconfig.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/spec/createconfig.go b/pkg/spec/createconfig.go
index 6a7ddc1ae..41030bf26 100644
--- a/pkg/spec/createconfig.go
+++ b/pkg/spec/createconfig.go
@@ -492,10 +492,7 @@ func (c *CreateConfig) CreatePortBindings() ([]ocicni.PortMapping, error) {
}
pm.HostPort = int32(hostPort)
- // CNI requires us to make both udp and tcp structs
- pm.Protocol = "udp"
- portBindings = append(portBindings, pm)
- pm.Protocol = "tcp"
+ pm.Protocol = containerPb.Proto()
portBindings = append(portBindings, pm)
}
}