mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 00:34:24 -04:00
plugin/kubernetes: correctly set NODATA for ns (#1229)
* plugin/kubernetes: Add GetNamespaceByName A bare or wildcard query for just the namespace should return NODATA, not NXDOMAIN, otherwise we deny the entirety of the names under the namespace. Add test to check for this in pod verified mode. * Review More comments and move namespace code to namespace.go
This commit is contained in:
@@ -332,6 +332,14 @@ func (APIConnServiceTest) GetNodeByName(name string) (*api.Node, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (APIConnServiceTest) GetNamespaceByName(name string) (*api.Namespace, error) {
|
||||
return &api.Namespace{
|
||||
ObjectMeta: meta.ObjectMeta{
|
||||
Name: name,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func TestServices(t *testing.T) {
|
||||
|
||||
k := New([]string{"interwebs.test."})
|
||||
|
||||
Reference in New Issue
Block a user