Kubernetes Web View to list and view all Kubernetes resources https://kube-web-view.readthedocs.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

13 lines
466 B

import re
from kube_web.web import is_allowed_namespace
def test_is_allowed_namespace():
assert is_allowed_namespace("a", [], [])
assert is_allowed_namespace("a", [re.compile("a")], [])
assert is_allowed_namespace("a", [], [re.compile("b")])
assert not is_allowed_namespace("a", [re.compile("b")], [])
assert not is_allowed_namespace("a", [], [re.compile("a")])
assert not is_allowed_namespace("default-foo", [re.compile("default")], [])