Skip to content

Commit

Permalink
Merge pull request #4068 from mikkeloscar/routegroup-ipv6-compatible
Browse files Browse the repository at this point in the history
Make routegroup client IPv6 compatible
  • Loading branch information
k8s-ci-robot committed Nov 27, 2023
2 parents a60480f + b48bb26 commit 4d04113
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/skipper_routegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ func NewRouteGroupSource(timeout time.Duration, token, tokenPath, apiServerURL,
apiServer := u.String()
// strip port if well known port, because of TLS certificate match
if u.Scheme == "https" && u.Port() == "443" {
apiServer = "https://" + u.Hostname()
// correctly handle IPv6 addresses by keeping surrounding `[]`.
apiServer = "https://" + strings.TrimSuffix(u.Host, ":443")
}

sc := &routeGroupSource{
Expand Down

0 comments on commit 4d04113

Please sign in to comment.