Skip to content

Commit 4856e73

Browse files
committed
Make sure the port forwarding protocol is always lowercase
The ServicePort.Protocol is always uppercase, e.g. "TCP", but the api.IPPort.protocol is always lowercase, i.e. "tcp". Since UDP support was added in #2411 the hostagent filters on the protocol values. Signed-off-by: Jan Dubois <[email protected]>
1 parent 9afb25c commit 4856e73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/guestagent/kubernetesservice/kubernetesservice.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"net"
88
"net/url"
99
"os"
10+
"strings"
1011
"sync"
1112
"time"
1213

@@ -142,7 +143,7 @@ func (s *ServiceWatcher) GetPorts() []Entry {
142143
}
143144

144145
entries = append(entries, Entry{
145-
Protocol: Protocol(portEntry.Protocol),
146+
Protocol: Protocol(strings.ToLower(string(portEntry.Protocol))),
146147
IP: net.ParseIP("0.0.0.0"),
147148
Port: uint16(port),
148149
})

0 commit comments

Comments
 (0)