mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 01:06:27 +00:00
dockershim: process protocol correctly for port mapping
This commit is contained in:
parent
ae6a5d2bf3
commit
2ddaaec199
@ -149,10 +149,10 @@ func makePortsAndBindings(pm []*runtimeapi.PortMapping) (map[dockernat.Port]stru
|
|||||||
// Some of this port stuff is under-documented voodoo.
|
// Some of this port stuff is under-documented voodoo.
|
||||||
// See http://stackoverflow.com/questions/20428302/binding-a-port-to-a-host-interface-using-the-rest-api
|
// See http://stackoverflow.com/questions/20428302/binding-a-port-to-a-host-interface-using-the-rest-api
|
||||||
var protocol string
|
var protocol string
|
||||||
switch strings.ToUpper(string(port.Protocol)) {
|
switch port.Protocol {
|
||||||
case "UDP":
|
case runtimeapi.Protocol_UDP:
|
||||||
protocol = "/udp"
|
protocol = "/udp"
|
||||||
case "TCP":
|
case runtimeapi.Protocol_TCP:
|
||||||
protocol = "/tcp"
|
protocol = "/tcp"
|
||||||
default:
|
default:
|
||||||
glog.Warningf("Unknown protocol %q: defaulting to TCP", port.Protocol)
|
glog.Warningf("Unknown protocol %q: defaulting to TCP", port.Protocol)
|
||||||
|
Loading…
Reference in New Issue
Block a user