diff --git a/src/main/helm/templates/configmap_spring_application_properties.yaml b/src/main/helm/templates/configmap_spring_application_properties.yaml new file mode 100644 index 0000000000000000000000000000000000000000..db08c38db66cd03fd888b5ed59fe47459c619da5 --- /dev/null +++ b/src/main/helm/templates/configmap_spring_application_properties.yaml @@ -0,0 +1,31 @@ +# +# Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den +# Ministerpräsidenten des Landes Schleswig-Holstein +# Staatskanzlei +# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung +# +# Lizenziert unter der EUPL, Version 1.2 oder - sobald +# diese von der Europäischen Kommission genehmigt wurden - +# Folgeversionen der EUPL ("Lizenz"); +# Sie dürfen dieses Werk ausschließlich gemäß +# dieser Lizenz nutzen. +# Eine Kopie der Lizenz finden Sie hier: +# +# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 +# +# Sofern nicht durch anwendbare Rechtsvorschriften +# gefordert oder in schriftlicher Form vereinbart, wird +# die unter der Lizenz verbreitete Software "so wie sie +# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN - +# ausdrücklich oder stillschweigend - verbreitet. +# Die sprachspezifischen Genehmigungen und Beschränkungen +# unter der Lizenz sind dem Lizenztext zu entnehmen. +# + +apiVersion: v1 +kind: ConfigMap +metadata: + name: spring-application-properties-configmap + namespace: {{ include "app.namespace" . }} +data: + properties.yaml: {{ .Values.properties | toYaml | quote }} \ No newline at end of file diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 4a23b3e047bba3fd91fef3b3d2ce3f165661e1a1..88bfa25ae44913f9218106484f60183a44c923a4 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -59,6 +59,8 @@ spec: app.kubernetes.io/name: {{ .Release.Name }} containers: - env: + - name: "spring_config_import" + value: "file:/etc/properties.yaml" - name: SERVICE_BINDING_ROOT value: "/bindings" - name: spring_profiles_active @@ -278,14 +280,6 @@ spec: - name: ozgcloud_feature_bescheid_kielHackathonRoute value: {{ quote (((.Values.ozgcloud).feature).bescheid).kielHackathonRoute }} {{- end }} - {{- if (((.Values.ozgcloud).notification).eingangsbestaetigung).forms }} - {{- range $i, $item := (((.Values.ozgcloud).notification).eingangsbestaetigung).forms }} - {{- range $key, $value := $item }} - - name: ozgcloud_notification_eingangsbestaetigung_forms_{{ printf "%d_%s" $i $key | replace "." "_" | replace "-" "" }} - value: {{ quote $value }} - {{- end }} - {{- end }} - {{- end }} {{- if ((.Values.ozgcloud).xdomea).behoerdenschluessel }} - name: ozgcloud_xdomea_behoerdenschluessel value: {{ ((.Values.ozgcloud).xdomea).behoerdenschluessel | quote }} @@ -467,6 +461,9 @@ spec: terminationMessagePolicy: File tty: true volumeMounts: + - name: spring-application-properties-volume + mountPath: /etc/properties.yaml + subPath: properties.yaml - name: bindings mountPath: "/bindings/ca-certificates/type" subPath: type @@ -518,6 +515,9 @@ spec: readOnly: true {{- end }} volumes: + - name: spring-application-properties-volume + configMap: + name: spring-application-properties-configmap - name: bindings configMap: name: bindings-type diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index 51f295e9052538c0707833fb211411f03a2477bd..72a50b0d38b2cb8d115a92248b3101c5df5ec401 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -63,6 +63,8 @@ elasticsearch: networkPolicy: zentralerEingangNamespace: zentraler-eingang +properties: {} + ozgcloud: muk: enabled: false diff --git a/src/test/helm/configmap_spring_application_properties_test.yaml b/src/test/helm/configmap_spring_application_properties_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..76a50b4583195e3d3ae12b9c71c061fab8295701 --- /dev/null +++ b/src/test/helm/configmap_spring_application_properties_test.yaml @@ -0,0 +1,67 @@ +# +# Copyright (C) 2022 Das Land Schleswig-Holstein vertreten durch den +# Ministerpräsidenten des Landes Schleswig-Holstein +# Staatskanzlei +# Abteilung Digitalisierung und zentrales IT-Management der Landesregierung +# +# Lizenziert unter der EUPL, Version 1.2 oder - sobald +# diese von der Europäischen Kommission genehmigt wurden - +# Folgeversionen der EUPL ("Lizenz"); +# Sie dürfen dieses Werk ausschließlich gemäß +# dieser Lizenz nutzen. +# Eine Kopie der Lizenz finden Sie hier: +# +# https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12 +# +# Sofern nicht durch anwendbare Rechtsvorschriften +# gefordert oder in schriftlicher Form vereinbart, wird +# die unter der Lizenz verbreitete Software "so wie sie +# ist", OHNE JEGLICHE GEWÄHRLEISTUNG ODER BEDINGUNGEN - +# ausdrücklich oder stillschweigend - verbreitet. +# Die sprachspezifischen Genehmigungen und Beschränkungen +# unter der Lizenz sind dem Lizenztext zu entnehmen. +# + +suite: Spring Application Properties ConfigMap +release: + name: vorgang-manager + namespace: sh-helm-test +templates: + - templates/configmap_spring_application_properties.yaml +tests: + - it: should have metadata + asserts: + - isKind: + of: ConfigMap + - isAPIVersion: + of: v1 + - equal: + path: metadata.name + value: spring-application-properties-configmap + - equal: + path: metadata.namespace + value: sh-helm-test + + - it: should have empty properties + asserts: + - equal: + path: data + value: + properties.yaml: '{}' + + - it: should populate properties + set: + properties: + some-key: some-value + some-key2: + - some-subkey: some-subvalue + some-subkey2: some-subvalue2 + asserts: + - equal: + path: data + value: + properties.yaml: | + some-key: some-value + some-key2: + - some-subkey: some-subvalue + some-subkey2: some-subvalue2 \ No newline at end of file diff --git a/src/test/helm/deployment_bindings_test.yaml b/src/test/helm/deployment_bindings_test.yaml index 51add5e564c008fd62e45d1837f0980bbf415edc..03db8803f9927e1174cb3911fa1bac6ae7c6827f 100644 --- a/src/test/helm/deployment_bindings_test.yaml +++ b/src/test/helm/deployment_bindings_test.yaml @@ -34,10 +34,9 @@ set: environment: dev bezeichner: helm imagePullSecret: test-image-pull-secret + usermanagerName: user-manager tests: - it: should have volumes - set: - usermanagerName: user-manager asserts: - contains: path: spec.template.spec.containers[0].volumeMounts @@ -47,8 +46,6 @@ tests: subPath: ca.crt readOnly: true - it: should have volume for user-manager-tls-certificate - set: - usermanagerName: user-manager asserts: - contains: path: spec.template.spec.volumes @@ -56,3 +53,19 @@ tests: name: user-manager-tls-certificate secret: secretName: user-manager-tls-cert + - it: should have volume mount for spring-application-properties + asserts: + - contains: + path: spec.template.spec.containers[0].volumeMounts + content: + name: spring-application-properties-volume + mountPath: /etc/properties.yaml + subPath: properties.yaml + - it: should have volume for spring-application-properties + asserts: + - contains: + path: spec.template.spec.volumes + content: + name: spring-application-properties-volume + configMap: + name: spring-application-properties-configmap diff --git a/src/test/helm/deployment_env_test.yaml b/src/test/helm/deployment_env_test.yaml index dff307461b6ef6bd13e0e96f0c87eca95c284046..880dd89422a162ac67838ec3d2c605208d01d660 100644 --- a/src/test/helm/deployment_env_test.yaml +++ b/src/test/helm/deployment_env_test.yaml @@ -32,6 +32,13 @@ set: bezeichner: helm imagePullSecret: test-image-pull-secret tests: + - it: should configure spring import config + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: spring_config_import + value: "file:/etc/properties.yaml" - it: check customList as list set: env.customList: @@ -142,59 +149,4 @@ tests: path: spec.template.spec.containers[0].env content: name: ozgcloud_processors_1_forms_0_formEngineName - value: FormSolutions - - it: should have notification properties - set: - ozgcloud: - notification: - eingangsbestaetigung: - forms: - - formEngineName: AFM - formId: 'Baumfaell*23' - antragstellerNotification: false - - formEngineName: 'AF?' - formId: '*genehmigung45' - addPrimaryPdf: false - - formEngineName: AFM - allowReplyByAntragsteller: true - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_0_formEngineName - value: "AFM" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_0_formId - value: "Baumfaell*23" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_0_antragstellerNotification - value: "false" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_1_formEngineName - value: "AF?" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_1_formId - value: "*genehmigung45" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_1_addPrimaryPdf - value: "false" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_2_formEngineName - value: "AFM" - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_notification_eingangsbestaetigung_forms_2_allowReplyByAntragsteller - value: "true" \ No newline at end of file + value: FormSolutions \ No newline at end of file