Commit d42d80c4 authored by Sandeep Rajan's avatar Sandeep Rajan Committed by Miek Gieben

cleanup by fmt and remove redundant type declarations (#2563)

parent 1fe66443
...@@ -13,7 +13,7 @@ import ( ...@@ -13,7 +13,7 @@ import (
func TestApex(t *testing.T) { func TestApex(t *testing.T) {
k := kubernetes.New([]string{"cluster.local."}) k := kubernetes.New([]string{"cluster.local."})
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
k.APIConn = &external{} k.APIConn = &external{}
e := New() e := New()
......
...@@ -17,7 +17,7 @@ import ( ...@@ -17,7 +17,7 @@ import (
func TestExternal(t *testing.T) { func TestExternal(t *testing.T) {
k := kubernetes.New([]string{"cluster.local."}) k := kubernetes.New([]string{"cluster.local."})
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
k.APIConn = &external{} k.APIConn = &external{}
e := New() e := New()
......
...@@ -22,13 +22,13 @@ var extCases = []struct { ...@@ -22,13 +22,13 @@ var extCases = []struct {
{ {
Qname: "svc1.testns.example.org.", Rcode: dns.RcodeSuccess, Qname: "svc1.testns.example.org.", Rcode: dns.RcodeSuccess,
Msg: []msg.Service{ Msg: []msg.Service{
msg.Service{Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"}, {Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
}, },
}, },
{ {
Qname: "svc6.testns.example.org.", Rcode: dns.RcodeSuccess, Qname: "svc6.testns.example.org.", Rcode: dns.RcodeSuccess,
Msg: []msg.Service{ Msg: []msg.Service{
msg.Service{Host: "1:2::5", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"}, {Host: "1:2::5", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
}, },
}, },
{ {
...@@ -37,7 +37,7 @@ var extCases = []struct { ...@@ -37,7 +37,7 @@ var extCases = []struct {
{ {
Qname: "_http._tcp.svc1.testns.example.com.", Rcode: dns.RcodeSuccess, Qname: "_http._tcp.svc1.testns.example.com.", Rcode: dns.RcodeSuccess,
Msg: []msg.Service{ Msg: []msg.Service{
msg.Service{Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"}, {Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
}, },
}, },
{ {
...@@ -52,7 +52,7 @@ func TestExternal(t *testing.T) { ...@@ -52,7 +52,7 @@ func TestExternal(t *testing.T) {
k := New([]string{"cluster.local."}) k := New([]string{"cluster.local."})
k.APIConn = &external{} k.APIConn = &external{}
k.Next = test.NextHandler(dns.RcodeSuccess, nil) k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
for i, tc := range extCases { for i, tc := range extCases {
state := testRequest(tc.Qname) state := testRequest(tc.Qname)
......
...@@ -347,7 +347,7 @@ func TestServeDNS(t *testing.T) { ...@@ -347,7 +347,7 @@ func TestServeDNS(t *testing.T) {
k := New([]string{"cluster.local."}) k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{} k.APIConn = &APIConnServeTest{}
k.Next = test.NextHandler(dns.RcodeSuccess, nil) k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO() ctx := context.TODO()
for i, tc := range dnsTestCases { for i, tc := range dnsTestCases {
...@@ -398,7 +398,7 @@ func TestNotSyncedServeDNS(t *testing.T) { ...@@ -398,7 +398,7 @@ func TestNotSyncedServeDNS(t *testing.T) {
notSynced: true, notSynced: true,
} }
k.Next = test.NextHandler(dns.RcodeSuccess, nil) k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO() ctx := context.TODO()
for i, tc := range notSyncedTestCases { for i, tc := range notSyncedTestCases {
......
...@@ -15,7 +15,7 @@ func TestKubernetesXFR(t *testing.T) { ...@@ -15,7 +15,7 @@ func TestKubernetesXFR(t *testing.T) {
k := New([]string{"cluster.local."}) k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{} k.APIConn = &APIConnServeTest{}
k.TransferTo = []string{"10.240.0.1:53"} k.TransferTo = []string{"10.240.0.1:53"}
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO() ctx := context.TODO()
w := dnstest.NewMultiRecorder(&test.ResponseWriter{}) w := dnstest.NewMultiRecorder(&test.ResponseWriter{})
...@@ -103,7 +103,7 @@ func TestKubernetesXFRNotAllowed(t *testing.T) { ...@@ -103,7 +103,7 @@ func TestKubernetesXFRNotAllowed(t *testing.T) {
k := New([]string{"cluster.local."}) k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{} k.APIConn = &APIConnServeTest{}
k.TransferTo = []string{"1.2.3.4:53"} k.TransferTo = []string{"1.2.3.4:53"}
k.Namespaces = map[string]struct{}{"testns": struct{}{}} k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO() ctx := context.TODO()
w := dnstest.NewMultiRecorder(&test.ResponseWriter{}) w := dnstest.NewMultiRecorder(&test.ResponseWriter{})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment