helm-charts/charts/library/common-test/tests/rbac/names_test.yaml
Bernd Schorgers 90e6b9e7cf
feat(common): Release 3.5.0 (#357)
Co-authored-by: Lawrence Gil <lawrence.gil@assemblyglobal.com>
2024-10-04 13:50:55 +00:00

58 lines
1.3 KiB
YAML

---
suite: rbac names
set:
serviceAccount:
name: test-sa
templates:
- common.yaml
values:
- ../_values/rbac_values.yaml
tests:
- it: default role and rolebinding names should pass
asserts:
- hasDocuments:
count: 4
- documentIndex: &RoleDocument 2
isKind:
of: Role
- documentIndex: *RoleDocument
equal:
path: metadata.name
value: RELEASE-NAME-defaultRole
- documentIndex: &BindingDocument 3
isKind:
of: RoleBinding
- documentIndex: *BindingDocument
equal:
path: metadata.name
value: RELEASE-NAME-defaultBinding
- it: custom role name should pass
set:
rbac:
roles:
defaultRole:
forceRename: customRole
bindings:
defaultBinding:
forceRename: customBinding
asserts:
- hasDocuments:
count: 4
- documentIndex: &RoleDocument 2
isKind:
of: Role
- documentIndex: &BindingDocument 3
isKind:
of: RoleBinding
- documentIndex: *RoleDocument
equal:
path: metadata.name
value: customRole
- documentIndex: *BindingDocument
equal:
path: metadata.name
value: customBinding