plugin/kubernetes: dont transfer unexposed namespaces (#2044)

dont transfer unexposed namespaces
This commit is contained in:
Chris O'Haver 2018-08-27 10:38:49 -04:00 committed by GitHub
parent d60993e021
commit 444472891f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View file

@ -330,6 +330,7 @@ func TestServeDNS(t *testing.T) {
k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{}
k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]bool{"testns": true}
ctx := context.TODO()
for i, tc := range dnsTestCases {
@ -478,6 +479,21 @@ var svcIndex = map[string][]*api.Service{
ClusterIP: api.ClusterIPNone,
},
}},
"svc1.unexposedns": {{
ObjectMeta: meta.ObjectMeta{
Name: "svc1",
Namespace: "unexposedns",
},
Spec: api.ServiceSpec{
Type: api.ServiceTypeClusterIP,
ClusterIP: "10.0.0.2",
Ports: []api.ServicePort{{
Name: "http",
Protocol: "tcp",
Port: 80,
}},
},
}},
}
func (APIConnServeTest) SvcIndex(s string) []*api.Service {