mw/kubernetes: remove kPod and kServices (#969)

Based up on: #939, but redone in a new PR with some cherry-picked
commits:
aacb91ef0b
5dc34247b7

This removes kPod and Kservice and creates []msg.Service from k.findPods
and k.findServices.

Updated few tests which I *think* are correct; they look correct to me.
This commit is contained in:
Miek Gieben 2017-08-23 07:19:41 +01:00 committed by GitHub
parent 7f5086e97a
commit 61fc672e19
7 changed files with 110 additions and 153 deletions

View file

@ -9,8 +9,6 @@ import (
)
func TestParseRequest(t *testing.T) {
k := New([]string{zone})
tests := []struct {
query string
expected string // output from r.String()
@ -27,7 +25,7 @@ func TestParseRequest(t *testing.T) {
m.SetQuestion(tc.query, dns.TypeA)
state := request.Request{Zone: zone, Req: m}
r, e := k.parseRequest(state)
r, e := parseRequest(state)
if e != nil {
t.Errorf("Test %d, expected no error, got '%v'.", i, e)
}
@ -39,8 +37,6 @@ func TestParseRequest(t *testing.T) {
}
func TestParseInvalidRequest(t *testing.T) {
k := New([]string{zone})
invalid := []string{
"webs.mynamespace.pood.inter.webs.test.", // Request must be for pod or svc subdomain.
"too.long.for.what.I.am.trying.to.pod.inter.webs.tests.", // Too long.
@ -51,7 +47,7 @@ func TestParseInvalidRequest(t *testing.T) {
m.SetQuestion(query, dns.TypeA)
state := request.Request{Zone: zone, Req: m}
if _, e := k.parseRequest(state); e == nil {
if _, e := parseRequest(state); e == nil {
t.Errorf("Test %d: expected error from %s, got none", i, query)
}
}