mw/kubernetes: remove kService and kPod

Remove the intermediate step of gathering everyhing in a kPod and
kService and extracting the msg.Service from there. Now findPods and
findServices return []msg.Service.

This cuts down on the code and also removed the double looping of
finding the data we need, so it should be faster.
This commit is contained in:
Miek Gieben
2017-08-22 07:53:11 +01:00
parent 0191ec74d8
commit aacb91ef0b
6 changed files with 95 additions and 148 deletions

View File

@@ -47,7 +47,7 @@ var dnsTestCases = map[string](test.Case){
},
"SRV Service Not udp/tcp": {
Qname: "*._not-udp-or-tcp.svc1.testns.svc.cluster.local.", Qtype: dns.TypeSRV,
Rcode: dns.RcodeSuccess,
Rcode: dns.RcodeNameError,
Ns: []dns.RR{
test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"),
},
@@ -105,6 +105,14 @@ var dnsTestCases = map[string](test.Case){
test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"),
},
},
"A Service (non-existing service)": {
Qname: "svc0.testns.svc.cluster.local.", Qtype: dns.TypeA,
Rcode: dns.RcodeNameError,
Answer: []dns.RR{},
Ns: []dns.RR{
test.SOA("cluster.local. 300 IN SOA ns.dns.cluster.local. hostmaster.cluster.local. 1499347823 7200 1800 86400 60"),
},
},
"TXT Schema": {
Qname: "dns-version.cluster.local.", Qtype: dns.TypeTXT,
Rcode: dns.RcodeSuccess,