plugin/kubernetes: Handle multiple local IPs and bind (#3208)
* use all local IPs * mult/bind ips * gofmt + boundIPs fix * fix no matching endpoint case * don't duplicate NS records in answer * fix answer dedup * fix comment * add multi local ip test case
This commit is contained in:
parent
d79562842a
commit
630d3d60b9
8 changed files with 91 additions and 51 deletions
|
@ -2,6 +2,7 @@ package kubernetes
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/coredns/coredns/plugin/pkg/dnstest"
|
||||
|
@ -63,6 +64,7 @@ func TestServeDNSApex(t *testing.T) {
|
|||
k := New([]string{"cluster.local."})
|
||||
k.APIConn = &APIConnServeTest{}
|
||||
k.Next = test.NextHandler(dns.RcodeSuccess, nil)
|
||||
k.localIPs = []net.IP{net.ParseIP("127.0.0.1")}
|
||||
ctx := context.TODO()
|
||||
|
||||
for i, tc := range kubeApexCases {
|
||||
|
@ -85,7 +87,7 @@ func TestServeDNSApex(t *testing.T) {
|
|||
}
|
||||
|
||||
if err := test.SortAndCheck(resp, tc); err != nil {
|
||||
t.Error(err)
|
||||
t.Errorf("Test %d: %v", i, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue