Skip to content

Commit

Permalink
build: adjust configuration for default testdata
Browse files Browse the repository at this point in the history
Refs: #205
  • Loading branch information
Phil91 committed Sep 24, 2024
1 parent 60f7903 commit 50feaef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@
* SPDX-License-Identifier: Apache-2.0
*/}}

{{- if .Values.migrations.seeding.testData.useDefaultTestData -}}
{{- if .Values.migrations.seeding.testData.useDefault -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-issuer-cm-seeding-testdata
name: {{ include "issuer.fullname" . }}-default-testdata
namespace: {{ .Release.Namespace }}
data:
use_cases.test.json: |-
use_cases.defaulttest.json: |-
[
{
"id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9",
"name": "None",
"shortname": "None"
}
]
verified_credential_external_type_detail_versions.test.json: |-
verified_credential_external_type_detail_versions.defaulttest.json: |-
[
{
"id": "d0f05b79-792c-4cb8-9b8d-6e476ac2e926",
Expand All @@ -51,14 +51,14 @@ data:
"expiry": "2025-10-16 00:00:00.000000 +00:00"
}
]
verified_credential_type_assigned_external_types.test.json: |-
verified_credential_type_assigned_external_types.defaulttest.json: |-
[
{
"verified_credential_external_type_id": 11,
"verified_credential_type_id": 11
}
]
verified_credential_type_assigned_use_cases.test.json: |-
verified_credential_type_assigned_use_cases.defaulttest.json: |-
[
{
"verified_credential_type_id": 11,
Expand Down
26 changes: 13 additions & 13 deletions charts/ssi-credential-issuer/templates/job-issuer-migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ spec:
value: "{{ .Values.migrations.seeding.testDataEnvironments }}"
- name: "SEEDING__DATAPATHS__0"
value: "Seeder/Data"
{{- if (.Values.migrations.seeding.testData.useDefaultTestData) }}
{{- if (.Values.migrations.seeding.testData.useDefault) }}
- name: "SEEDING__DATAPATHS__1"
value: "Seeder/Data/import/default"
value: "Seeder/Data/import/default-test-data"
- name: "SEEDING__TESTDATAENVIRONMENTS__1"
value: "test"
value: "defaulttest"
{{- end }}
{{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }}
{{- if (.Values.migrations.seeding.testData.useDefaultTestData) }}
{{- if (.Values.migrations.seeding.testData.useDefault) }}
- name: "SEEDING__DATAPATHS__2"
value: "Seeder/Data/import/custom"
value: "Seeder/Data/import/custom-test-data"
- name: "SEEDING__TESTDATAENVIRONMENTS__2"
value: "{{ .Values.migrations.seeding.testData.filename }}"
{{ else }}
- name: "SEEDING__DATAPATHS__1"
value: "Seeder/Data/import/custom"
value: "Seeder/Data/import/custom-test-data"
- name: "SEEDING__TESTDATAENVIRONMENTS__1"
value: "{{ .Values.migrations.seeding.testData.filename }}"
{{- end }}
Expand All @@ -100,23 +100,23 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.migrations.resources | nindent 10 }}
{{- if or (.Values.migrations.seeding.testData.useDefaultTestData) (and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename)) }}
{{- if or (.Values.migrations.seeding.testData.useDefault) (and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename)) }}
volumeMounts:
{{- if (.Values.migrations.seeding.testData.useDefaultTestData) }}
{{- if (.Values.migrations.seeding.testData.useDefault) }}
- name: test-data-default
mountPath: /migrations/Seeder/Data/import/default
mountPath: /migrations/Seeder/Data/import/default-test-data
{{- end }}
{{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }}
- name: test-data-custom
mountPath: /migrations/Seeder/Data/import/custom
mountPath: /migrations/Seeder/Data/import/custom-test-data
{{- end }}
{{- end }}
{{- if or (.Values.migrations.seeding.testData.useDefaultTestData) (and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename)) }}
{{- if or (.Values.migrations.seeding.testData.useDefault) (and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename)) }}
volumes:
{{- if (.Values.migrations.seeding.testData.useDefaultTestData) }}
{{- if (.Values.migrations.seeding.testData.useDefault) }}
- name: test-data-default
configMap:
name: "{{ .Release.Name }}-issuer-cm-seeding-testdata"
name: "{{ include "issuer.fullname" . }}-default-testdata"
optional: true
{{- end }}
{{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }}
Expand Down
3 changes: 2 additions & 1 deletion charts/ssi-credential-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ migrations:
seeding:
testDataEnvironments: ""
testData:
useDefaultTestData: false
# -- If set to true the data configured in the config map 'configmap-seeding-testdata.yaml' will be taken to insert the default test data
useDefault: 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
2 changes: 1 addition & 1 deletion environments/helm-values/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ migrations:
logging:
default: "Debug"
testData:
useDefaultTestData: true
useDefault: true

processesworker:
logging:
Expand Down

0 comments on commit 50feaef

Please sign in to comment.