Skip to content
Snippets Groups Projects
Commit 2bed3b1d authored by OZGCloud's avatar OZGCloud
Browse files

adapter default service account name

parent 21d7639f
No related branches found
No related tags found
No related merge requests found
......@@ -83,5 +83,15 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}}
{{- define "app.serviceAccountName" -}}
{{ printf "%s" ( (.Values.serviceAccount).name | default "eingang-manager-service-account" ) }}
{{- if (.Values.serviceAccount).name }}
{{- printf "%s" .Values.serviceAccount.name }}
{{- else if eq (.Values.image).name "intelliform-adapter" }}
{{- printf "afm-adapter-service-account" }}
{{- else if eq (.Values.image).name "formsolutions-adapter" }}
{{- printf "fs-adapter-service-account" }}
{{- else if eq (.Values.image).name "formcycle-adapter" }}
{{- printf "formcycle-adapter-service-account" }}
{{- else if eq (.Values.image).name "enterprise-adapter" }}
{{- printf "enterprise-adapter-service-account" }}
{{- end }}
{{- end -}}
\ No newline at end of file
......@@ -29,14 +29,42 @@ release:
templates:
- templates/deployment.yaml
tests:
- it: should use service account with default name
- it: should use afm-adapter service account name
set:
image.name: intelliform-adapter
serviceAccount:
create: true
asserts:
- equal:
path: spec.template.spec.serviceAccountName
value: eingang-manager-service-account
value: afm-adapter-service-account
- it: should use fs-adapter service account name
set:
image.name: formsolutions-adapter
serviceAccount:
create: true
asserts:
- equal:
path: spec.template.spec.serviceAccountName
value: fs-adapter-service-account
- it: should use formcycle-adapter service account name
set:
image.name: formcycle-adapter
serviceAccount:
create: true
asserts:
- equal:
path: spec.template.spec.serviceAccountName
value: formcycle-adapter-service-account
- it: should use enterprise-adapter service account name
set:
image.name: enterprise-adapter
serviceAccount:
create: true
asserts:
- equal:
path: spec.template.spec.serviceAccountName
value: enterprise-adapter-service-account
- it: should use service account with name
set:
serviceAccount:
......
......@@ -29,8 +29,9 @@ release:
templates:
- templates/service_account.yaml
tests:
- it: should create service account with default name
- it: should create default afm adapter service account name
set:
image.name: intelliform-adapter
serviceAccount:
create: true
asserts:
......@@ -38,7 +39,49 @@ tests:
of: ServiceAccount
- equal:
path: metadata.name
value: eingang-manager-service-account
value: afm-adapter-service-account
- equal:
path: metadata.namespace
value: sh-helm-test
- it: should create default fs adapter service account name
set:
image.name: formsolutions-adapter
serviceAccount:
create: true
asserts:
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: fs-adapter-service-account
- equal:
path: metadata.namespace
value: sh-helm-test
- it: should create default formcycle adapter service account name
set:
image.name: formcycle-adapter
serviceAccount:
create: true
asserts:
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: formcycle-adapter-service-account
- equal:
path: metadata.namespace
value: sh-helm-test
- it: should create default enterprise adapter service account name
set:
image.name: enterprise-adapter
serviceAccount:
create: true
asserts:
- isKind:
of: ServiceAccount
- equal:
path: metadata.name
value: enterprise-adapter-service-account
- equal:
path: metadata.namespace
value: sh-helm-test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment