charts/teleport-kube-agent/tests/clusterrole_test.yaml
2024-08-15 22:45:43 +08:00

44 lines
989 B
YAML

suite: ClusterRole
templates:
- clusterrole.yaml
tests:
- it: creates a ClusterRole
asserts:
- hasDocuments:
count: 1
- isKind:
of: ClusterRole
- matchSnapshot: {}
- it: sets ClusterRole labels when specified
values:
- ../.lint/extra-labels.yaml
asserts:
- equal:
path: metadata.labels.app\.kubernetes\.io/name
value: teleport-kube-agent
- equal:
path: metadata.labels.resource
value: clusterrole
- matchSnapshot: {}
- it: adds services listing permission if discovery is enabled
set:
roles: kube,discovery
asserts:
- hasDocuments:
count: 1
- isKind:
of: ClusterRole
- matchSnapshot: {}
- it: does not add services listing permission if discovery is disabled
set:
roles: kube
asserts:
- hasDocuments:
count: 1
- isKind:
of: ClusterRole
- matchSnapshot: {}