mirror of
https://github.com/containers/podman.git
synced 2025-06-29 15:08:09 +08:00
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>
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user