plugin/kubernetes: dont transfer unexposed namespaces (#2044)
dont transfer unexposed namespaces
This commit is contained in:
parent
d60993e021
commit
444472891f
3 changed files with 20 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue