Skip to content

Commit

Permalink
fix: handle IPv6 addresses correctly in API calls to Kong
Browse files Browse the repository at this point in the history
IPv6 addresses contain colon(`:`) which results in incorrect parsing and interpretation.

From #118
  • Loading branch information
NixM0nk3y authored and hbagdi committed Sep 10, 2018
1 parent 2c99413 commit 1fa2c1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/ingress/controller/kong.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package controller
import (
"bytes"
"fmt"
"net"
"net/http"
"os"
"reflect"
Expand Down Expand Up @@ -230,7 +231,7 @@ func syncTargets(upstream string, ingressEndpopint *ingress.Backend, client *kon

newTargets := sets.NewString()
for _, endpoint := range ingressEndpopint.Endpoints {
nt := fmt.Sprintf("%v:%v", endpoint.Address, endpoint.Port)
nt := net.JoinHostPort(endpoint.Address, endpoint.Port)
if !newTargets.Has(nt) {
newTargets.Insert(nt)
}
Expand Down

0 comments on commit 1fa2c1e

Please sign in to comment.