Skip to content
Snippets Groups Projects
Commit 1beba748 authored by Lukas Malte Monnerjahn's avatar Lukas Malte Monnerjahn
Browse files

Merge branch 'OZG-4880-OSIv2-helm' into 'main'

OZG-4880 Helm Env Values für OSI-Postfach 2.0

See merge request !24
parents ea12a026 e600489a
No related branches found
No related tags found
1 merge request!24OZG-4880 Helm Env Values für OSI-Postfach 2.0
...@@ -97,6 +97,40 @@ spec: ...@@ -97,6 +97,40 @@ spec:
value: {{ .Values.osipostfach.httpproxy.auth.password }} value: {{ .Values.osipostfach.httpproxy.auth.password }}
{{- end }} {{- end }}
{{- end }} {{- end }}
- name: ozgcloud_osiv2_enabled
value: "{{ (.Values.ozgcloud.osiv2).enabled }}"
{{- if (.Values.ozgcloud.osiv2).enabled}}
- name: ozgcloud_osiv2_auth_client-id
valueFrom:
secretKeyRef:
name: osiv2-auth
key: client-id
- name: ozgcloud_osiv2_auth_client-secret
valueFrom:
secretKeyRef:
name: osiv2-auth
key: client-secret
- name: ozgcloud_osiv2_auth_scope
value: {{ .Values.ozgcloud.osiv2.auth.scope }}
- name: ozgcloud_osiv2_auth_token-uri
value: {{ .Values.ozgcloud.osiv2.auth.tokenuri }}
- name: ozgcloud_osiv2_auth_resource
value: {{ .Values.ozgcloud.osiv2.auth.resource }}
- name: ozgcloud_osiv2_api_url
value: {{ .Values.ozgcloud.osiv2.api.url }}
- name: ozgcloud_osiv2_api_tenant
value: {{ .Values.ozgcloud.osiv2.api.tenant}}
- name: ozgcloud_osiv2_api_name-identifier
value: {{ .Values.ozgcloud.osiv2.api.nameidentifier}}
{{- if (.Values.ozgcloud.osiv2.httpproxy).enabled}}
- name: ozgcloud_osiv2_http-proxy_enabled
value: "{{ .Values.ozgcloud.osiv2.httpproxy.enabled }}"
- name: ozgcloud_osiv2_http-proxy_host
value: {{ .Values.ozgcloud.osiv2.httpproxy.host }}
- name: ozgcloud_osiv2_http-proxy_port
value: "{{ .Values.ozgcloud.osiv2.httpproxy.port }}"
{{- end }}
{{- end }}
{{- if (.Values.rabbitmq).enabled }} {{- if (.Values.rabbitmq).enabled }}
- name: spring_rabbitmq_username - name: spring_rabbitmq_username
valueFrom: valueFrom:
......
#
# Copyright (C) 2025 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.
#
{{- if (.Values.ozgcloud.osiv2).enabled }}
apiVersion: v1
kind: Secret
metadata:
name: osiv2-auth
namespace: {{ include "app.namespace" . }}
type: Opaque
stringData:
client-id: {{ .Values.ozgcloud.osiv2.auth.clientid }}
client-secret: {{ .Values.ozgcloud.osiv2.auth.clientsecret }}
{{- end }}
\ No newline at end of file
...@@ -71,3 +71,5 @@ ozgcloud: ...@@ -71,3 +71,5 @@ ozgcloud:
namespace: namespace:
aggregationManager: aggregationManager:
enabled: false enabled: false
osiv2:
enabled: false
...@@ -40,21 +40,21 @@ set: ...@@ -40,21 +40,21 @@ set:
imagePullSecret: test-image-pull-secret imagePullSecret: test-image-pull-secret
tests: tests:
- it: should not fail on .Release.Namespace length less than 63 characters
asserts:
- notFailedTemplate: { }
- it: should fail on .Release.Namespace length longer than 63 characters - it: should fail on .Release.Namespace length longer than 63 characters
release: release:
namespace: test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 namespace: test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: .Release.Namespace test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 63 Zeichen) errorMessage: .Release.Namespace test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 63 Zeichen)
- it: should not fail on .Release.Namespace length less than 63 characters - it: should not fail on .Chart.Name-.Chart.Version length less than 63 characters
asserts: asserts:
- notFailedTemplate: {} - notFailedTemplate: { }
- it: should fail on .Chart.Name-.Chart.Version length longer than 63 characters - it: should fail on .Chart.Name-.Chart.Version length longer than 63 characters
chart: chart:
version: 1.0-test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 version: 1.0-test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890
asserts: asserts:
- failedTemplate: - failedTemplate:
errorMessage: .Chart.Name-.Chart.Version vorgang-manager-1.0-test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 63 Zeichen) errorMessage: .Chart.Name-.Chart.Version vorgang-manager-1.0-test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 63 Zeichen)
- it: should not fail on .Chart.Name-.Chart.Version length less than 63 characters
asserts:
- notFailedTemplate: {}
\ No newline at end of file
#
# Copyright (C) 2025 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: deployment osiv2
release:
name: vorgang-manager
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
baseUrl: test.sh.ozg-cloud.de
imagePullSecret: test-image-pull-secret
ozgcloud:
environment: dev
bezeichner: helm
osiv2:
auth:
clientid: "client-id"
clientsecret: "client-secret"
scope: "scope"
tokenuri: "token-uri"
resource: "resource"
api:
url: "https://api.url"
tenant: "tenant"
nameidentifier: "name-identifier"
httpproxy:
enabled: false
tests:
- it: should set osiv2 values
set:
ozgcloud:
osiv2:
enabled: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_enabled
value: "true"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_client-id
valueFrom:
secretKeyRef:
key: client-id
name: osiv2-auth
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_client-secret
valueFrom:
secretKeyRef:
key: client-secret
name: osiv2-auth
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_scope
value: "scope"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_token-uri
value: "token-uri"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_resource
value: "resource"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_api_url
value: "https://api.url"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_api_tenant
value: "tenant"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_api_name-identifier
value: "name-identifier"
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_http-proxy_enabled
any: true
- it: should set osiv2 proxy values
set:
ozgcloud:
osiv2:
enabled: true
httpproxy:
enabled: true
host: "http://proxy.host"
port: 8080
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_http-proxy_enabled
value: "true"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_http-proxy_host
value: "http://proxy.host"
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_http-proxy_port
value: "8080"
- it: should not by default set osiv2 values
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_enabled
value: "false"
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_client_id
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_client_secret
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_scope
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_token-uri
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_auth_resource
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_api_url
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_api_tenant
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_api_name-identifier
any: true
- notContains:
path: spec.template.spec.containers[0].env
content:
name: ozgcloud_osiv2_http_proxy_enabled
any: true
...@@ -47,12 +47,11 @@ tests: ...@@ -47,12 +47,11 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 1
documentIndex: 1 documentIndex: 0
- it: should NOT create cr if not enabled - it: should NOT create cr if not enabled
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
documentIndex: 0
- it: should NOT create cr if disableOzgCloudOperator true - it: should NOT create cr if disableOzgCloudOperator true
set: set:
elasticsearch: elasticsearch:
...@@ -61,5 +60,4 @@ tests: ...@@ -61,5 +60,4 @@ tests:
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 0 count: 0
documentIndex: 0
\ No newline at end of file
#
# Copyright (C) 2025 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: test osiv2 auth secret
release:
name: vorgang-manager
namespace: sh-helm-test
templates:
- templates/osiv2_auth_secret.yaml
set:
ozgcloud:
osiv2:
auth:
clientid: "client-id"
clientsecret: "client-secret"
tests:
- it: test metadata
set:
ozgcloud.osiv2.enabled: true
asserts:
- isKind:
of: Secret
- isAPIVersion:
of: v1
- equal:
path: metadata.name
value: osiv2-auth
- equal:
path: metadata.namespace
value: sh-helm-test
- it: test secret type
set:
ozgcloud.osiv2.enabled: true
asserts:
- equal:
path: type
value: Opaque
- it: should have stringData
set:
ozgcloud.osiv2.enabled: true
asserts:
- equal:
path: stringData.client-id
value: "client-id"
- equal:
path: stringData.client-secret
value: "client-secret"
- it: should not create osiv2 auth secret by default
asserts:
- hasDocuments:
count: 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment