Skip to content

Commit

Permalink
feat: adjust config map configuration
Browse files Browse the repository at this point in the history
Refs: #205
  • Loading branch information
Phil91 committed Sep 24, 2024
1 parent 775542e commit b6547a7
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* SPDX-License-Identifier: Apache-2.0
*/}}

{{- if .Values.migrations.seeding.testData.useDefaultTestData -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down Expand Up @@ -64,3 +65,4 @@ data:
"use_case_id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9"
}
]
{{- end -}}
46 changes: 42 additions & 4 deletions charts/ssi-credential-issuer/templates/job-issuer-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}
1 change: 1 addition & 0 deletions charts/ssi-credential-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions environments/helm-values/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ migrations:
logging:
default: "Debug"
testData:
configMap: "{{ .Release.Name }}-issuer-cm-seeding-testdata"
filename: "test"
useDefaultTestData: true

processesworker:
logging:
Expand Down

0 comments on commit b6547a7

Please sign in to comment.