Esempio n. 1
0
def test_matches_resource_filter():
    foo_ns = Namespace(None, {"metadata": {"name": "foo"}})
    assert not matches_resource_filter(foo_ns, [], [], [], [])
    assert not matches_resource_filter(foo_ns, ALL, [], [], [])
    assert matches_resource_filter(foo_ns, ALL, [], ALL, [])
    assert not matches_resource_filter(foo_ns, ALL, [], ALL, ["foo"])
    assert not matches_resource_filter(foo_ns, ALL, ["namespaces"], ALL, [])
    assert matches_resource_filter(foo_ns, ALL, ["deployments"], ALL, ["kube-system"])
Esempio n. 2
0
def test_matches_resource_filter():
    foo_ns = Namespace(None, {'metadata': {'name': 'foo'}})
    assert not matches_resource_filter(foo_ns, [], [], [], [])
    assert not matches_resource_filter(foo_ns, ALL, [], [], [])
    assert matches_resource_filter(foo_ns, ALL, [], ALL, [])
    assert not matches_resource_filter(foo_ns, ALL, [], ALL, ['foo'])
    assert not matches_resource_filter(foo_ns, ALL, ['namespaces'], ALL, [])
    assert matches_resource_filter(foo_ns, ALL, ['deployments'], ALL,
                                   ['kube-system'])