Skip to content

Commit

Permalink
Ignores IPv6 addresses containing a zone index #5981
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Rose <louis.rose@anaplan.com>
  • Loading branch information
Louis Rose committed Dec 7, 2022
1 parent a8d4552 commit 1b1552d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/k8s/portforward.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ func getListenableAddresses(host string) ([]string, error) {
for _, addr := range addresses {
var l net.Listener
if ipv6 := strings.Contains(addr, ":"); ipv6 {
// skip ipv6 address that include a zone index
// see: https://github.com/tilt-dev/tilt/issues/5981
if hasZoneIndex := strings.Contains(addr, "%"); hasZoneIndex {
continue
}

l, err = net.Listen("tcp6", fmt.Sprintf("[%s]:0", addr))
} else {
l, err = net.Listen("tcp4", fmt.Sprintf("%s:0", addr))
Expand Down

0 comments on commit 1b1552d

Please sign in to comment.