diff options
author | 2017-08-18 14:45:20 +0100 | |
---|---|---|
committer | 2017-08-18 14:45:20 +0100 | |
commit | f96cf27193032120ba727316c4057dffed0cbe48 (patch) | |
tree | c76caa111aba281560a3b7db91953e307c06f1c9 /middleware/kubernetes/parse_test.go | |
parent | cc4e4a0626bf8881e2ae8b2c1e52e09c6308e74e (diff) | |
download | coredns-f96cf27193032120ba727316c4057dffed0cbe48.tar.gz coredns-f96cf27193032120ba727316c4057dffed0cbe48.tar.zst coredns-f96cf27193032120ba727316c4057dffed0cbe48.zip |
mw/federation: add federation back as separate mw for k8s (#929)
* mw/federaration
This PR add the federation back as a middleware to keep it more
contained from the main kubernetes code.
It also makes parseRequest less import and pushes this functionlity down
in the k.Entries. This minimizes (or tries to) the importance for the
qtype in the query. In the end the qtype checking should only happen
in ServeDNS - but for k8s this might proof difficult.
Numerous other cleanup in code and kubernetes tests.
* up test coverage
Diffstat (limited to 'middleware/kubernetes/parse_test.go')
-rw-r--r-- | middleware/kubernetes/parse_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/middleware/kubernetes/parse_test.go b/middleware/kubernetes/parse_test.go index 951a47554..0a3d224e4 100644 --- a/middleware/kubernetes/parse_test.go +++ b/middleware/kubernetes/parse_test.go @@ -4,11 +4,12 @@ import ( "testing" "github.com/coredns/coredns/request" + "github.com/miekg/dns" ) func TestParseRequest(t *testing.T) { - k := Kubernetes{Zones: []string{zone}} + k := New([]string{zone}) tests := []struct { query string @@ -30,10 +31,6 @@ func TestParseRequest(t *testing.T) { "1-2-3-4.webs.mynamespace.svc.inter.webs.test.", dns.TypeA, "..1-2-3-4.webs.mynamespace.svc.intern.webs.tests.", }, - { - "inter.webs.test.", dns.TypeNS, - "......intern.webs.tests.", - }, } for i, tc := range tests { m := new(dns.Msg) @@ -52,7 +49,7 @@ func TestParseRequest(t *testing.T) { } func TestParseInvalidRequest(t *testing.T) { - k := Kubernetes{Zones: []string{zone}} + k := New([]string{zone}) invalid := map[string]uint16{ "_http._tcp.webs.mynamespace.svc.inter.webs.test.": dns.TypeA, // A requests cannot have port or protocol |