From b6547a7a4ca94c78e887a9c49a2916ca2d2dbfab Mon Sep 17 00:00:00 2001 From: Phil Schneider Date: Tue, 24 Sep 2024 15:21:18 +0200 Subject: [PATCH] feat: adjust config map configuration Refs: #205 --- .../templates/configmap-seeding-testdata.yaml | 2 + .../templates/job-issuer-migrations.yaml | 46 +++++++++++++++++-- charts/ssi-credential-issuer/values.yaml | 1 + environments/helm-values/values-int.yaml | 3 +- 4 files changed, 46 insertions(+), 6 deletions(-) diff --git a/charts/ssi-credential-issuer/templates/configmap-seeding-testdata.yaml b/charts/ssi-credential-issuer/templates/configmap-seeding-testdata.yaml index 9defa08d..c60cf375 100644 --- a/charts/ssi-credential-issuer/templates/configmap-seeding-testdata.yaml +++ b/charts/ssi-credential-issuer/templates/configmap-seeding-testdata.yaml @@ -17,6 +17,7 @@ * SPDX-License-Identifier: Apache-2.0 */}} +{{- if .Values.migrations.seeding.testData.useDefaultTestData -}} apiVersion: v1 kind: ConfigMap metadata: @@ -64,3 +65,4 @@ data: "use_case_id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9" } ] +{{- end -}} diff --git a/charts/ssi-credential-issuer/templates/job-issuer-migrations.yaml b/charts/ssi-credential-issuer/templates/job-issuer-migrations.yaml index 8b089c8a..a48bd2f7 100644 --- a/charts/ssi-credential-issuer/templates/job-issuer-migrations.yaml +++ b/charts/ssi-credential-issuer/templates/job-issuer-migrations.yaml @@ -66,12 +66,25 @@ spec: - name: "SEEDING__TESTDATAENVIRONMENTS__0" value: "{{ .Values.migrations.seeding.testDataEnvironments }}" - name: "SEEDING__DATAPATHS__0" - value: "Seeder/Data" + value: "Seeder/Data" + {{- if (.Values.migrations.seeding.testData.useDefaultTestData) }} + - name: "SEEDING__DATAPATHS__1" + value: "Seeder/Data/import/default" + - name: "SEEDING__TESTDATAENVIRONMENTS__1" + value: "test" + {{- end }} {{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }} + {{- if (.Values.migrations.seeding.testData.useDefaultTestData) }} + - name: "SEEDING__DATAPATHS__2" + value: "Seeder/Data/import/custom" + - name: "SEEDING__TESTDATAENVIRONMENTS__2" + value: "{{ .Values.migrations.seeding.testData.filename }}" + {{ else }} - name: "SEEDING__DATAPATHS__1" - value: "Seeder/Data/import" + value: "Seeder/Data/import/custom" - name: "SEEDING__TESTDATAENVIRONMENTS__1" - value: "{{ .Values.migrations.seeding.testData.filename }}" + value: "{{ .Values.migrations.seeding.testData.filename }}" + {{- end }} {{- end }} - name: "SERILOG__MINIMUMLEVEL__Default" value: "{{ .Values.migrations.logging.default }}" @@ -83,4 +96,29 @@ spec: protocol: TCP resources: {{- toYaml .Values.migrations.resources | nindent 10 }} - {{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }} + {{- if or (.Values.migrations.seeding.testData.useDefaultTestData) (and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename)) }} + volumeMounts: + {{- if (.Values.migrations.seeding.testData.useDefaultTestData) }} + - name: test-data-default + mountPath: /migrations/Seeder/Data/import/default + {{- end }} + {{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }} + - name: test-data-custom + mountPath: /migrations/Seeder/Data/import/custom + {{- end }} + {{- end }} + {{- if or (.Values.migrations.seeding.testData.useDefaultTestData) (and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename)) }} + volumes: + {{- if (.Values.migrations.seeding.testData.useDefaultTestData) }} + - name: test-data-default + configMap: + name: "{{ .Release.Name }}-issuer-cm-seeding-testdata" + optional: true + {{- end }} + {{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }} + - name: test-data-custom + configMap: + name: "{{ .Values.migrations.seeding.testData.configMap }}" + optional: true + {{- end }} + {{- end }} diff --git a/charts/ssi-credential-issuer/values.yaml b/charts/ssi-credential-issuer/values.yaml index 89c8f60d..7094bcc5 100644 --- a/charts/ssi-credential-issuer/values.yaml +++ b/charts/ssi-credential-issuer/values.yaml @@ -87,6 +87,7 @@ migrations: seeding: testDataEnvironments: "" testData: + useDefaultTestData: false # -- ConfigMap containing json files for the tables to seed, e.g. use_cases.json, verified_credential_external_type_detail_versions.test.json, etc. configMap: "" # -- Filename identifying the test data files e.g. for companies.test.json the value would be "test" diff --git a/environments/helm-values/values-int.yaml b/environments/helm-values/values-int.yaml index 5f17b96b..4cb7ff2d 100644 --- a/environments/helm-values/values-int.yaml +++ b/environments/helm-values/values-int.yaml @@ -59,8 +59,7 @@ migrations: logging: default: "Debug" testData: - configMap: "{{ .Release.Name }}-issuer-cm-seeding-testdata" - filename: "test" + useDefaultTestData: true processesworker: logging: