Skip to content
Snippets Groups Projects
Commit c4eeb4f6 authored by OZG-Cloud Team's avatar OZG-Cloud Team
Browse files

Merge branch 'master' into knecht-root-recht-stage

parents 0217e08b dd47e693
No related branches found
No related tags found
No related merge requests found
Showing
with 129 additions and 26 deletions
......@@ -30,6 +30,7 @@ templates:
- deployment.yaml
set:
image.tag: latest
ozgcloud.environment: test
tests:
- it: validate default routing values without questions.yaml
asserts:
......
......@@ -28,6 +28,9 @@ release:
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
tests:
- it: should use afm-adapter service account name
set:
......
......@@ -27,6 +27,7 @@ release:
name: if-adapter
templates:
- templates/deployment.yaml
tests:
- it: should override spring profiles
set:
......@@ -40,6 +41,8 @@ tests:
name: spring_profiles_active
value: oc,stage,ea
- it: should generate spring profiles
set:
ozgcloud.environment: test
asserts:
- isKind:
of: Deployment
......
......@@ -28,6 +28,8 @@ release:
namespace: sh-helm-test
templates:
- deployment.yaml
set:
ozgcloud.environment: test
tests:
- it: validate image type and container image
asserts:
......
......@@ -25,6 +25,11 @@
suite: test ingress creation dependent from values
templates:
- templates/ingress.yaml
set:
ozgcloud:
bezeichner: helm
tests:
- it: create ingress by config
set:
......
......@@ -25,6 +25,11 @@
suite: test ingress options
templates:
- templates/ingress.yaml
set:
ozgcloud:
bezeichner: helm
tests:
- it: should create afm ingress tls
release:
......
......@@ -28,6 +28,9 @@ release:
namespace: sh-helm-test
templates:
- templates/ingress.yaml
set:
ozgcloud:
bezeichner: helm
tests:
- it: should match basic data
asserts:
......
......@@ -2,6 +2,6 @@
set -e
helm template ./src/main/helm/ -f src/main/helm/test-values.yaml
helm lint -f src/test/helm/values/unit-values.yaml ./src/main/helm/
cd src/main/helm && helm unittest -f '../../test/helm/*.yaml' -v '../../test/helm/values/unit-values.yaml' .
\ No newline at end of file
helm template ./src/main/helm/ -f src/test/helm-linter-values.yaml
helm lint -f src/test/helm-linter-values.yaml ./src/main/helm/
cd src/main/helm && helm unittest -f '../../test/helm/*.yaml' .
{{/* vim: set filetype=mustache: */}}
{{/* Truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec) */}}
{{/* Name */}}
{{- define "app.name" -}}
{{- default .Release.Name | toString | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* error check 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec) */}}
{{/* Namespace */}}
{{- define "app.namespace" -}}
{{- default .Release.Namespace | toString | trunc 63 | trimSuffix "-" -}}
{{- if gt (len (.Release.Namespace)) 63 -}}
{{- fail (printf ".Release.Namespace %s ist zu lang (max. 63 Zeichen)" .Release.Namespace) -}}
{{- end -}}
{{/* Version */}}
{{- define "app.version" -}}
{{- default .Chart.Version | toString | trunc 63 | trimSuffix "-" -}}
{{ printf "%s" .Release.Namespace }}
{{- end -}}
{{/* Chart: Name + Version */}}
{{- define "app.chart" -}}
{{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- if gt (len (printf "%s-%s" .Chart.Name .Chart.Version)) 63 -}}
{{- fail (printf ".Chart.Name-.Chart.Version %s-%s ist zu lang (max. 63 Zeichen)" .Chart.Name .Chart.Version) -}}
{{- end -}}
{{ printf "%s-%s" .Chart.Name .Chart.Version }}
{{- end -}}
{{/* Managed-by -> On Helm, this value is always Helm */}}
{{- define "app.managedBy" -}}
{{- default .Release.Service | toString | trunc 63 | trimSuffix "-" -}}
{{- if gt (len (.Release.Service)) 63 -}}
{{- fail (printf ".Release.Service %s ist zu lang (max. 63 Zeichen)" .Release.Service) -}}
{{- end -}}
{{ printf "%s" .Release.Service }}
{{- end -}}
{{/* Default Labels: Helm recommended best-practice labels https://helm.sh/docs/chart_best_practices/labels/ */}}
{{- define "app.defaultLabels" }}
app.kubernetes.io/instance: {{ include "app.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ include "app.managedBy" . }}
app.kubernetes.io/name: {{ include "app.name" . }}
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/part-of: ozgcloud
app.kubernetes.io/version: {{ include "app.version" . }}
app.kubernetes.io/version: {{ .Chart.Version }}
app.kubernetes.io/namespace: {{ include "app.namespace" . }}
helm.sh/chart: {{ include "app.chart" . }}
{{- end -}}
......
......@@ -26,7 +26,7 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "app.name" . }}-image-pull-secret
name: {{ .Release.Name }}-image-pull-secret
namespace: {{ include "app.namespace" . }}
type: kubernetes.io/dockerconfigjson
data:
......
......@@ -25,7 +25,7 @@
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "app.name" . }}
name: {{ .Release.Name }}
namespace: {{ include "app.namespace" . }}
labels:
{{- include "app.defaultLabels" . | indent 4 }}
......@@ -166,7 +166,7 @@ spec:
{{- if .Values.imagePullSecret }}
- name: {{ .Values.imagePullSecret }}
{{ else }}
- name: {{ include "app.name" . }}-image-pull-secret
- name: {{ .Release.Name }}-image-pull-secret
{{- end }}
{{- if (.Values.securityContext).fsGroup }}
securityContext:
......
......@@ -9,6 +9,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import de.ozgcloud.eingang.common.formdata.FormData;
import de.ozgcloud.eingang.common.formdata.FormHeader;
import de.ozgcloud.eingang.common.vorgang.VorgangNummerSupplier;
import lombok.NonNull;
import lombok.extern.log4j.Log4j2;
......@@ -17,11 +19,14 @@ import lombok.extern.log4j.Log4j2;
class XtaService {
static final String DFOERDERMITTELANTRAG_MESSAGE_TYPE = "Geschaeftsgang.Geschaeftsgang.0201";
static final int VORGANG_NUMMER_SUFFIX_LENGTH = 4;
@Autowired
private XtaRemoteService remoteService;
@Autowired
private XtaMessageMapper mapper;
@Autowired
private VorgangNummerSupplier vorgangNummerSupplier;
public Stream<FormData> getMessages() {
return createXtaMessageStream().filter(this::filterByMessageType).map(this::getFormData);
......@@ -45,7 +50,16 @@ class XtaService {
public FormData getFormData(@NonNull XtaMessageMetaData metaData) {
var msg = remoteService.getMessage(metaData.getMessageId());
return mapper.toFormData(msg.toBuilder().metaData(metaData).build());
var formData = mapper.toFormData(msg.toBuilder().metaData(metaData).build());
return updateHeader(formData);
}
FormData updateHeader(FormData formData) {
return formData.toBuilder().header(setVorgangNummer(formData.getHeader())).build();
}
FormHeader setVorgangNummer(FormHeader formHeader) {
return formHeader.toBuilder().vorgangNummer(vorgangNummerSupplier.get(VORGANG_NUMMER_SUFFIX_LENGTH)).build();
}
public void acknowledgeReceive(@NonNull XtaMessageId messageId) {
......
......@@ -28,6 +28,8 @@ templates:
release:
name: xta-adapter
namespace: helm-test
set:
ozgcloud.environment: test
tests:
- it: should use service account with default name
set:
......
......@@ -22,17 +22,34 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen.
#
baseUrl: test.sh.ozg-cloud.de
suite: test less than 63 chars
release:
name: xta-adapter
namespace: sh-helm-test
set:
ozgcloud.environment: test
chart:
name: xta-adapter
ozgcloud:
bundesland: sh
environment: test
bezeichner: helm
templates:
- templates/xta_adapter_cronjob.yaml
routing:
targetVorgangManagerName: vorgang-manager
image:
repo: docker.ozg-sh.de
name: intelliform-adapter
tag: latest
tests:
- it: should fail on .Release.Namespace length longer than 63 characters
release:
namespace: test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890
asserts:
- failedTemplate:
errorMessage: .Release.Namespace test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 63 Zeichen)
- it: should not fail on .Release.Namespace length less than 63 characters
asserts:
- notFailedTemplate: {}
- it: should fail on .Chart.Name-.Chart.Version length longer than 63 characters
chart:
version: 1.0-test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890
asserts:
- failedTemplate:
errorMessage: .Chart.Name-.Chart.Version xta-adapter-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
......@@ -25,6 +25,8 @@
suite: xta-adapter bindings
templates:
- templates/xta_adapter_cronjob.yaml
set:
ozgcloud.environment: test
tests:
- it: should have temp-dir volume
asserts:
......
......@@ -28,6 +28,9 @@ templates:
release:
name: xta-adapter
namespace: helm-test
set:
ozgcloud.environment: dev
tests:
- it: validate basic data
template: xta_adapter_cronjob.yaml
......@@ -70,7 +73,6 @@ tests:
template: xta_adapter_cronjob.yaml
set:
image.name: xta-adapter
ozgcloud.environment: dev
asserts:
- equal:
path: spec.schedule
......@@ -79,7 +81,6 @@ tests:
template: xta_adapter_cronjob.yaml
set:
image.name: xta-adapter
ozgcloud.environment: dev
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.containers[0].image
......
......@@ -28,6 +28,8 @@ templates:
release:
name: xta-adapter
namespace: helm-test
set:
ozgcloud.environment: test
tests:
- it: check dummy livenessProbe default disabled
template: xta_adapter_cronjob.yaml
......
......@@ -28,6 +28,8 @@ templates:
release:
name: xta-adapter
namespace: helm-test
set:
ozgcloud.environment: test
tests:
- it: check default env
template: xta_adapter_cronjob.yaml
......
......@@ -28,8 +28,12 @@ release:
namespace: sh-helm-test
templates:
- templates/xta_adapter_cronjob.yaml
set:
ozgcloud.environment: dev
tests:
- it: should use default imagePull secret
set:
asserts:
- equal:
path: spec.jobTemplate.spec.template.spec.imagePullSecrets[0].name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment