summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorUrvashi Mohnani <umohnani@redhat.com>2021-10-14 15:03:18 -0400
committerUrvashi Mohnani <umohnani@redhat.com>2021-10-14 17:03:14 -0400
commit16e7cc8bf17c88f2ec422037ab5a1fc640bfb800 (patch)
tree0d584f2ef1562d3d7f6bff416c14ceda2b773886 /libpod
parent8d44c548c085c65cae33398b322eabadb6b237f7 (diff)
downloadpodman-16e7cc8bf17c88f2ec422037ab5a1fc640bfb800.tar.gz
podman-16e7cc8bf17c88f2ec422037ab5a1fc640bfb800.tar.bz2
podman-16e7cc8bf17c88f2ec422037ab5a1fc640bfb800.zip
Do not add TCP to protocol in generated kube yaml
As the default protocol in k8s is TCP, don't add it to the generate yaml when using protocol. Add UDP to the protocol of the generated yaml when udp is being used. Add tests for this as well. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/kube.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/kube.go b/libpod/kube.go
index d68140d5e..5a33bc968 100644
--- a/libpod/kube.go
+++ b/libpod/kube.go
@@ -578,7 +578,8 @@ func ocicniPortMappingToContainerPort(portMappings []types.OCICNIPortMapping) ([
var protocol v1.Protocol
switch strings.ToUpper(p.Protocol) {
case "TCP":
- protocol = v1.ProtocolTCP
+ // do nothing as it is the default protocol in k8s, there is no need to explicitly
+ // add it to the generated yaml
case "UDP":
protocol = v1.ProtocolUDP
default: