fix(common): adding feature flag for default serviceaccount name (#360)

This commit is contained in:
Lawrence Gil 2024-10-08 16:31:24 +02:00 committed by GitHub
parent 3e2f1204e0
commit f111be38e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 89 additions and 17 deletions

View file

@ -27,6 +27,41 @@ tests:
isKind:
of: ServiceAccount
- it: controller uses named ServiceAccount by default
set:
serviceAccount:
create: false
name: &ServiceAccountName test
asserts:
- hasDocuments:
count: 1
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.serviceAccountName
value: *ServiceAccountName
- it: controller uses `default` ServiceAccount if flag is enabled
set:
enforceServiceAccountCreation: true
serviceAccount:
create: false
name: test
asserts:
- hasDocuments:
count: 1
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.serviceAccountName
value: default
- it: a serviceAccount and Secret are created when enabled
set:
serviceAccount: