123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- suite: rbac metadata test
- templates:
- - common.yaml
- chart:
- appVersion: &appVer v9.9.9
- tests:
- - it: should pass with rbac created with labels and annotations
- set:
- label1: label1
- label2: global_label2
- annotation1: annotation1
- annotation2: global_annotation2
- global:
- labels:
- g_label1: global_label1
- g_label2: "{{ .Values.label2 }}"
- annotations:
- g_annotation1: global_annotation1
- g_annotation2: "{{ .Values.annotation2 }}"
- serviceAccount:
- my-sa1:
- enabled: true
- primary: true
- rbac:
- my-rbac1:
- enabled: true
- primary: true
- labels:
- label1: "{{ .Values.label1 }}"
- label2: label2
- annotations:
- annotation1: "{{ .Values.annotation1 }}"
- annotation2: annotation2
- rules:
- - apiGroups:
- - ""
- resources:
- - pods
- verbs:
- - get
- - list
- - watch
- my-rbac2:
- enabled: true
- primary: false
- clusterWide: true
- allServiceAccounts: true
- labels:
- label1: "{{ .Values.label1 }}"
- label2: label2
- annotations:
- annotation1: "{{ .Values.annotation1 }}"
- annotation2: annotation2
- rules:
- - apiGroups:
- - ""
- resources:
- - pods
- verbs:
- - get
- - list
- - watch
- asserts:
- - documentIndex: &roleDoc 1
- isKind:
- of: Role
- - documentIndex: *roleDoc
- equal:
- path: metadata.annotations
- value:
- annotation1: annotation1
- annotation2: annotation2
- g_annotation1: global_annotation1
- g_annotation2: global_annotation2
- - documentIndex: *roleDoc
- equal:
- path: metadata.labels
- value:
- app: common-test-1.0.0
- release: RELEASE-NAME
- helm-revision: "0"
- helm.sh/chart: common-test-1.0.0
- app.kubernetes.io/managed-by: Helm
- app.kubernetes.io/version: *appVer
- g_label1: global_label1
- g_label2: global_label2
- label1: label1
- label2: label2
- - documentIndex: &roleBindingDoc 2
- isKind:
- of: RoleBinding
- - documentIndex: *roleBindingDoc
- equal:
- path: metadata.annotations
- value:
- annotation1: annotation1
- annotation2: annotation2
- g_annotation1: global_annotation1
- g_annotation2: global_annotation2
- - documentIndex: *roleBindingDoc
- equal:
- path: metadata.labels
- value:
- app: common-test-1.0.0
- release: RELEASE-NAME
- helm-revision: "0"
- helm.sh/chart: common-test-1.0.0
- app.kubernetes.io/managed-by: Helm
- app.kubernetes.io/version: *appVer
- g_label1: global_label1
- g_label2: global_label2
- label1: label1
- label2: label2
- - documentIndex: &clusterRoleDoc 3
- isKind:
- of: ClusterRole
- - documentIndex: *clusterRoleDoc
- equal:
- path: metadata.annotations
- value:
- annotation1: annotation1
- annotation2: annotation2
- g_annotation1: global_annotation1
- g_annotation2: global_annotation2
- - documentIndex: *clusterRoleDoc
- equal:
- path: metadata.labels
- value:
- app: common-test-1.0.0
- release: RELEASE-NAME
- helm-revision: "0"
- helm.sh/chart: common-test-1.0.0
- app.kubernetes.io/managed-by: Helm
- app.kubernetes.io/version: *appVer
- g_label1: global_label1
- g_label2: global_label2
- label1: label1
- label2: label2
- - documentIndex: &clusterRoleBindingDoc 4
- isKind:
- of: ClusterRoleBinding
- - documentIndex: *clusterRoleBindingDoc
- equal:
- path: metadata.annotations
- value:
- annotation1: annotation1
- annotation2: annotation2
- g_annotation1: global_annotation1
- g_annotation2: global_annotation2
- - documentIndex: *clusterRoleBindingDoc
- equal:
- path: metadata.labels
- value:
- app: common-test-1.0.0
- release: RELEASE-NAME
- helm-revision: "0"
- helm.sh/chart: common-test-1.0.0
- app.kubernetes.io/managed-by: Helm
- app.kubernetes.io/version: *appVer
- g_label1: global_label1
- g_label2: global_label2
- label1: label1
- label2: label2
|