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:
parent
9018451dd3
commit
c37bf56b1e
8 changed files with 101 additions and 10 deletions
|
@ -476,3 +476,14 @@ func (APIConnServeTest) GetNodeByName(name string) (*api.Node, error) {
|
|||
},
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (APIConnServeTest) GetNamespaceByName(name string) (*api.Namespace, error) {
|
||||
if name == "pod-nons" { // hanlder_pod_verified_test.go uses this for non-existent namespace.
|
||||
return &api.Namespace{}, nil
|
||||
}
|
||||
return &api.Namespace{
|
||||
ObjectMeta: meta.ObjectMeta{
|
||||
Name: name,
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue