Skip to content

Commit

Permalink
feat(seeding): move configmap into own file
Browse files Browse the repository at this point in the history
Refs: #205
  • Loading branch information
Phil91 committed Sep 24, 2024
1 parent ba6db7a commit 2e46817
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 43 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{- /*
* Copyright (c) 2024 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*
* SPDX-License-Identifier: Apache-2.0
*/}}

{{- if .Values.postgresql.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-issuer-cm-seeding-testdata
namespace: {{ .Release.Namespace }}
data:
use_cases.test.json: |-
[
{
"id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9",
"name": "None",
"shortname": "None"
}
]
verified_credential_external_type_detail_versions.test.json: |-
[
{
"id": "d0f05b79-792c-4cb8-9b8d-6e476ac2e926",
"verified_credential_external_type_id": 2,
"version": "0.0",
"template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Governance_Framework/231016_Catena-X_Use_Case_Framework_PCF.pdf",
"valid_from": "2023-01-01 00:00:00.000000 +00:00",
"expiry": "2023-12-31 00:00:00.000000 +00:00"
},
{
"id": "2d17a933-f65f-49cd-84a9-cff299a79f85",
"verified_credential_external_type_id": 11,
"version": "1.0",
"template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Governance_Framework/example.pdf",
"valid_from": "2024-10-16 00:00:00.000000 +00:00",
"expiry": "2025-10-16 00:00:00.000000 +00:00"
}
]
verified_credential_type_assigned_external_types.test.json: |-
[
{
"verified_credential_external_type_id": 11,
"verified_credential_type_id": 11
}
]
verified_credential_type_assigned_use_cases.test.json: |-
[
{
"verified_credential_type_id": 11,
"use_case_id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,4 @@ spec:
protocol: TCP
resources:
{{- toYaml .Values.migrations.resources | nindent 10 }}
{{- if and (.Values.migrations.seeding.testData.configMap) (.Values.migrations.seeding.testData.filename) }}
2 changes: 1 addition & 1 deletion charts/ssi-credential-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ migrations:
seeding:
testDataEnvironments: ""
testData:
# -- ConfigMap containing json files for the tables to seed, e.g. companies.test.json, addresses.test.json, etc.
# -- 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"
filename: ""
Expand Down
42 changes: 0 additions & 42 deletions environments/argocd-app-templates/appsetup-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,45 +36,3 @@ spec:
- name: helm_args
value: '-f values.yaml -f ../../environments/helm-values/values-int.yaml'
project: project-portal
data:
use_cases.test.json: |-
[
{
"id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9",
"name": "None",
"shortname": "None"
}
]
verified_credential_external_type_detail_versions.test.json: |-
[
{
"id": "d0f05b79-792c-4cb8-9b8d-6e476ac2e926",
"verified_credential_external_type_id": 2,
"version": "0.0",
"template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Governance_Framework/231016_Catena-X_Use_Case_Framework_PCF.pdf",
"valid_from": "2023-01-01 00:00:00.000000 +00:00",
"expiry": "2023-12-31 00:00:00.000000 +00:00"
},
{
"id": "2d17a933-f65f-49cd-84a9-cff299a79f85",
"verified_credential_external_type_id": 11,
"version": "1.0",
"template": "https://catena-x.net/fileadmin/user_upload/04_Einfuehren_und_umsetzen/Governance_Framework/example.pdf",
"valid_from": "2024-10-16 00:00:00.000000 +00:00",
"expiry": "2025-10-16 00:00:00.000000 +00:00"
}
]
verified_credential_type_assigned_external_types.test.json: |-
[
{
"verified_credential_external_type_id": 11,
"verified_credential_type_id": 11
}
]
verified_credential_type_assigned_use_cases.test.json: |-
[
{
"verified_credential_type_id": 11,
"use_case_id": "1aacde78-35ec-4df3-ba1e-f988cddcbbd9"
}
]
3 changes: 3 additions & 0 deletions environments/helm-values/values-int.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ service:
migrations:
logging:
default: "Debug"
testData:
configMap: "{{ .Release.Name }}-issuer-cm-seeding-testdata"
filename: "test"

processesworker:
logging:
Expand Down

0 comments on commit 2e46817

Please sign in to comment.