ingress-nginx-helm/charts/ingress-nginx/tests/default-backend-serviceaccount_test.yaml

52 lines
1.5 KiB
YAML
Raw Normal View History

suite: Default Backend > ServiceAccount
templates:
- default-backend-serviceaccount.yaml
tests:
- it: should not create a ServiceAccount if `defaultBackend.serviceAccount.create` is false
set:
defaultBackend.enabled: true
defaultBackend.serviceAccount.create: false
asserts:
- hasDocuments:
count: 0
- it: should create a ServiceAccount if `defaultBackend.serviceAccount.create` is true
set:
defaultBackend.enabled: true
defaultBackend.serviceAccount.create: true
asserts:
- hasDocuments:
count: 1
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-backend
- it: should create a ServiceAccount with specified name if `defaultBackend.serviceAccount.name` is set
set:
defaultBackend.enabled: true
defaultBackend.serviceAccount.name: ingress-nginx-admission-test-sa
asserts:
- hasDocuments:
count: 1
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: ingress-nginx-admission-test-sa
- it: should create a ServiceAccount with token auto-mounting disabled if `defaultBackend.serviceAccount.automountServiceAccountToken` is false
set:
defaultBackend.enabled: true
defaultBackend.serviceAccount.automountServiceAccountToken: false
asserts:
- hasDocuments:
count: 1
- isKind:
of: ServiceAccount
- equal:
path: automountServiceAccountToken
value: false