Skip to content

Commit 021c974

Browse files
authored
Merge pull request #2825 from jandubois/k8s-portforwarding
Make sure the port forwarding protocol is always lowercase
2 parents 9afb25c + 9aaa7bb commit 021c974

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/guestagent/kubernetesservice/kubernetesservice.go

Lines changed: 3 additions & 2 deletions
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

@@ -24,7 +25,7 @@ type Protocol string
2425
const (
2526
// UDP/SCTP when lima port forwarding works on those protocols.
2627

27-
TCP Protocol = "TCP"
28+
TCP Protocol = "tcp"
2829
)
2930

3031
type Entry struct {
@@ -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)