mirror of
https://github.com/hanzo-ml/kuberay.git
synced 2026-10-30 19:48:47 +00:00
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
suite: Test ClusterRoleBinding
|
|
|
|
templates:
|
|
- rolebinding.yaml
|
|
|
|
release:
|
|
name: kuberay-operator
|
|
namespace: kuberay-system
|
|
|
|
tests:
|
|
- it: Should not create ClusterRoleBinding if `rbacEnable` is `false`
|
|
set:
|
|
rbacEnable: false
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 0
|
|
|
|
- it: Should not create ClusterRoleBinding if `singleNamespaceInstall` is `true`
|
|
set:
|
|
singleNamespaceInstall: true
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 0
|
|
|
|
- it: Should create ClusterRoleBinding if `rbacEnable` is `true` and `singleNamespaceInstall` is `false`
|
|
set:
|
|
rbacEnable: true
|
|
singleNamespaceInstall: false
|
|
asserts:
|
|
- containsDocument:
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRoleBinding
|
|
name: kuberay-operator
|
|
|
|
- it: Should bind ClusterRole to ServiceAccount
|
|
set:
|
|
rbacEnable: true
|
|
singleNamespaceInstall: false
|
|
asserts:
|
|
- equal:
|
|
path: roleRef
|
|
value:
|
|
apiGroup: rbac.authorization.k8s.io
|
|
kind: ClusterRole
|
|
name: kuberay-operator
|
|
- contains:
|
|
path: subjects
|
|
content:
|
|
kind: ServiceAccount
|
|
name: kuberay-operator
|
|
namespace: kuberay-system
|