diff --git a/library/common-test/tests/pod/deployment_container_default_test.yaml b/library/common-test/tests/pod/deployment_default_test.yaml similarity index 98% rename from library/common-test/tests/pod/deployment_container_default_test.yaml rename to library/common-test/tests/pod/deployment_default_test.yaml index 701182548f..e2e4b4a195 100644 --- a/library/common-test/tests/pod/deployment_container_default_test.yaml +++ b/library/common-test/tests/pod/deployment_default_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container default test +suite: deployment default test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_container_podSecurityContext_test.yaml b/library/common-test/tests/pod/deployment_podSecurityContext_test.yaml similarity index 97% rename from library/common-test/tests/pod/deployment_container_podSecurityContext_test.yaml rename to library/common-test/tests/pod/deployment_podSecurityContext_test.yaml index 1314286353..a76896d69b 100644 --- a/library/common-test/tests/pod/deployment_container_podSecurityContext_test.yaml +++ b/library/common-test/tests/pod/deployment_podSecurityContext_test.yaml @@ -1,4 +1,4 @@ -suite: deployment container podSecurityContext test +suite: deployment podSecurityContext test templates: - common.yaml tests: diff --git a/library/common-test/tests/pod/deployment_serviceAccountName_test.yaml b/library/common-test/tests/pod/deployment_serviceAccountName_test.yaml new file mode 100644 index 0000000000..bbdd33d285 --- /dev/null +++ b/library/common-test/tests/pod/deployment_serviceAccountName_test.yaml @@ -0,0 +1,50 @@ + +suite: deployment serviceAccountName +templates: + - common.yaml +chart: + appVersion: v1.2.3 +tests: + - it: should pass with default values + asserts: + - isKind: + of: Deployment + + - it: should pass (have correct serviceAccountName) with service account enabled + documentIndex: &deploymentDoc 1 + set: + serviceAccount: + main: + enabled: true + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: RELEASE-NAME-common-test + + - it: should pass (have correct serviceAccountName) with primary service account enabled and nameOverride defined + documentIndex: *deploymentDoc + set: + serviceAccount: + main: + enabled: true + nameOverride: some-name + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: RELEASE-NAME-common-test-some-name + + - it: should pass (have correct serviceAccountName) with non-primary service account enabled and nameOverride defined + documentIndex: &deploymentDoc 2 + set: + serviceAccount: + main: + enabled: true + primary: true + other: + enabled: true + primary: false + nameOverride: some-name + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: RELEASE-NAME-common-test diff --git a/library/common-test/tests/pod/deployment_serviceAccount_test.yaml b/library/common-test/tests/serviceAccount/serviceAccount_test.yaml similarity index 100% rename from library/common-test/tests/pod/deployment_serviceAccount_test.yaml rename to library/common-test/tests/serviceAccount/serviceAccount_test.yaml diff --git a/library/common/1.0.0/templates/spawner/_serviceAccount.tpl b/library/common/1.0.0/templates/spawner/_serviceAccount.tpl index 8463f69153..d75937c0ed 100644 --- a/library/common/1.0.0/templates/spawner/_serviceAccount.tpl +++ b/library/common/1.0.0/templates/spawner/_serviceAccount.tpl @@ -14,7 +14,7 @@ {{- end -}} {{/* - Pass a serviceAccount object with this single SA to the class, + Pass a serviceAccount object containing this single SA to the class, in order to create the object. Also pass "root" for includes to work. */}} {{- include "ix.v1.common.class.serviceAccount" (dict "serviceAccount" $saValues "root" $) -}}