Skip to content
Snippets Groups Projects
Commit d682c50a authored by OZGCloud's avatar OZGCloud
Browse files

Merge branch 'master' of git.ozg-sh.de:ozgcloud-app/eingang-manager

parents e541d92d 6af600e5
No related branches found
No related tags found
No related merge requests found
Showing
with 260 additions and 102 deletions
...@@ -4,4 +4,4 @@ set -e ...@@ -4,4 +4,4 @@ set -e
helm template ./src/main/helm/ -f src/test/helm-linter-values.yaml helm template ./src/main/helm/ -f src/test/helm-linter-values.yaml
helm lint -f src/test/helm-linter-values.yaml ./src/main/helm/ helm lint -f src/test/helm-linter-values.yaml ./src/main/helm/
cd src/main/helm && helm unittest -f '../../test/helm/*.yaml' . cd src/main/helm && helm unittest -f '../../test/helm/**/*test.yaml' .
\ No newline at end of file \ No newline at end of file
...@@ -42,11 +42,6 @@ app.kubernetes.io/name: {{ .Release.Name }} ...@@ -42,11 +42,6 @@ app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/namespace: {{ include "app.namespace" . }} app.kubernetes.io/namespace: {{ include "app.namespace" . }}
{{- end -}} {{- end -}}
{{- define "app.imagePullSecret" }}
{{- with .Values.imageCredentials }}
{{- printf "{\"auths\":{\"%s\":{\"username\":\"%s\",\"password\":\"%s\",\"email\":\"%s\",\"auth\":\"%s\"}}}" .registry .username .password .email (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- end }}
{{- define "app.envSpringProfiles" }} {{- define "app.envSpringProfiles" }}
{{- if (.Values.env).overrideSpringProfiles -}} {{- if (.Values.env).overrideSpringProfiles -}}
......
...@@ -156,11 +156,7 @@ spec: ...@@ -156,11 +156,7 @@ spec:
dnsConfig: {} dnsConfig: {}
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
imagePullSecrets: imagePullSecrets:
{{- if .Values.imagePullSecret }} - name: {{ required "imagePullSecret must be set" .Values.imagePullSecret }}
- name: {{ .Values.imagePullSecret }}
{{ else }}
- name: {{ .Release.Name }}-image-pull-secret
{{- end }}
restartPolicy: Always restartPolicy: Always
{{- with .Values.hostAliases }} {{- with .Values.hostAliases }}
hostAliases: hostAliases:
......
#
# 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.
#
{{- if not (.Values.imagePullSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}-image-pull-secret
namespace: {{ include "app.namespace" . }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ include "app.imagePullSecret" . }}
{{- end }}
\ No newline at end of file
...@@ -29,3 +29,5 @@ ozgcloud: ...@@ -29,3 +29,5 @@ ozgcloud:
networkPolicy: networkPolicy:
dnsServerNamespace: test-dns-server-namespace dnsServerNamespace: test-dns-server-namespace
imagePullSecret: image-pull-secret
\ No newline at end of file
...@@ -31,6 +31,7 @@ chart: ...@@ -31,6 +31,7 @@ chart:
name: eingang-manager name: eingang-manager
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
......
...@@ -27,6 +27,7 @@ templates: ...@@ -27,6 +27,7 @@ templates:
- templates/deployment.yaml - templates/deployment.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: should have temp-dir volume - it: should have temp-dir volume
asserts: asserts:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment container security
release: release:
name: eingang-manager name: eingang-manager
namespace: sh-helm-test namespace: sh-helm-test
...@@ -30,11 +30,10 @@ templates: ...@@ -30,11 +30,10 @@ templates:
- templates/deployment.yaml - templates/deployment.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: check default values - it: check default values
asserts: asserts:
- isKind:
of: Deployment
- equal: - equal:
path: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation path: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation
value: false value: false
......
#
# 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: test deployment health check
release:
name: eingang-manager
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should have correct health check values
asserts:
- equal:
path: spec.template.spec.containers[0].readinessProbe.failureThreshold
value: 3
- equal:
path: spec.template.spec.containers[0].readinessProbe.httpGet.path
value: /actuator/health/readiness
- equal:
path: spec.template.spec.containers[0].readinessProbe.httpGet.port
value: 8081
- equal:
path: spec.template.spec.containers[0].readinessProbe.httpGet.scheme
value: HTTP
- equal:
path: spec.template.spec.containers[0].readinessProbe.periodSeconds
value: 10
- equal:
path: spec.template.spec.containers[0].readinessProbe.successThreshold
value: 1
- equal:
path: spec.template.spec.containers[0].readinessProbe.timeoutSeconds
value: 3
- equal:
path: spec.template.spec.containers[0].startupProbe.failureThreshold
value: 10
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.path
value: /actuator/health/readiness
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.port
value: 8081
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.scheme
value: HTTP
- equal:
path: spec.template.spec.containers[0].startupProbe.initialDelaySeconds
value: 30
- equal:
path: spec.template.spec.containers[0].startupProbe.periodSeconds
value: 5
- equal:
path: spec.template.spec.containers[0].startupProbe.successThreshold
value: 1
- equal:
path: spec.template.spec.containers[0].startupProbe.timeoutSeconds
value: 5
\ No newline at end of file
...@@ -22,28 +22,28 @@ ...@@ -22,28 +22,28 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment default label
release: release:
name: intelliform-adapter name: intelliform-adapter
namespace: sh-helm-test namespace: sh-helm-test
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
- templates/service_monitor.yaml
- templates/service.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: check default labels - it: check default labels
asserts: asserts:
- equal: - equal:
path: metadata.labels["app.kubernetes.io/instance"] path: metadata.labels
value: afm-adapter value:
- equal: app.kubernetes.io/instance: afm-adapter
path: metadata.labels["app.kubernetes.io/name"] app.kubernetes.io/managed-by: Helm
value: intelliform-adapter app.kubernetes.io/name: intelliform-adapter
- equal: app.kubernetes.io/namespace: sh-helm-test
path: metadata.labels["app.kubernetes.io/part-of"] app.kubernetes.io/part-of: ozgcloud
value: ozgcloud app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS
- equal: helm.sh/chart: Intelliform-Adapter-0.0.0-MANAGED-BY-JENKINS
path: metadata.labels["app.kubernetes.io/namespace"] ozg-component: eingangsadapter
value: sh-helm-test
#
# 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: test deployment actuator
release:
name: eingang-manager
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: check for some standard values
asserts:
- equal:
path: spec.template.spec.containers[0].image
value: docker.ozg-sh.de/intelliform-adapter:latest
- equal:
path: spec.template.spec.containers[0].imagePullPolicy
value: Always
- equal:
path: spec.template.spec.containers[0].name
value: intelliform-adapter
- equal:
path: spec.template.spec.containers[0].ports[0].containerPort
value: 8080
- equal:
path: spec.template.spec.containers[0].ports[0].name
value: 8080tcp1
- equal:
path: spec.template.spec.containers[0].ports[0].protocol
value: TCP
- equal:
path: spec.template.spec.containers[0].stdin
value: true
- equal:
path: spec.template.spec.containers[0].terminationMessagePath
value: /dev/termination-log
- equal:
path: spec.template.spec.containers[0].terminationMessagePolicy
value: File
- equal:
path: spec.template.spec.containers[0].tty
value: true
- equal:
path: spec.template.spec.containers[0].ports[1].containerPort
value: 8081
- equal:
path: spec.template.spec.containers[0].ports[1].name
value: metrics
- equal:
path: spec.template.spec.containers[0].ports[1].protocol
value: TCP
\ No newline at end of file
...@@ -22,33 +22,27 @@ ...@@ -22,33 +22,27 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment topology
release: release:
name: intelliform-adapter name: eingang-manager
namespace: sh-helm-test namespace: sh-helm-test
templates: templates:
- deployment.yaml - templates/deployment.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: validate image type and container image - it: check default values
asserts: asserts:
- isKind:
of: Deployment
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.topologySpreadConstraints[0].maxSkew
value: docker.ozg-sh.de/intelliform-adapter:latest value: 1
- it: validate image pull secret resource name
asserts:
- equal: - equal:
path: spec.template.spec.imagePullSecrets[0].name path: spec.template.spec.topologySpreadConstraints[0].topologyKey
value: intelliform-adapter-image-pull-secret value: kubernetes.io/hostname
- equal: - equal:
path: spec.template.spec.containers[0].image path: spec.template.spec.topologySpreadConstraints[0].whenUnsatisfiable
value: docker.ozg-sh.de/intelliform-adapter:latest value: DoNotSchedule
- it: should have label ozg-component
asserts:
- equal: - equal:
path: metadata.labels.ozg-component path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels["app.kubernetes.io/name"]
value: eingangsadapter value: eingang-manager
\ No newline at end of file
...@@ -22,14 +22,14 @@ ...@@ -22,14 +22,14 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test environments suite: test environments customList
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: check customList - it: check customList
template: deployment.yaml
set: set:
env.customList: env.customList:
- name: my_test_environment_name - name: my_test_environment_name
...@@ -41,7 +41,6 @@ tests: ...@@ -41,7 +41,6 @@ tests:
name: my_test_environment_name name: my_test_environment_name
value: "A test value" value: "A test value"
- it: check customList test value is not set by default - it: check customList test value is not set by default
template: deployment.yaml
asserts: asserts:
- notContains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
......
...@@ -31,6 +31,7 @@ templates: ...@@ -31,6 +31,7 @@ templates:
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: should not set hostAliases - it: should not set hostAliases
asserts: asserts:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment imagepullsecret
release: release:
name: afm-adapter name: afm-adapter
namespace: sh-helm-test namespace: sh-helm-test
...@@ -31,19 +31,14 @@ templates: ...@@ -31,19 +31,14 @@ templates:
set: set:
ozgcloud.environment: test ozgcloud.environment: test
tests: tests:
- it: should use default imagePull secret
asserts:
- isKind:
of: Deployment
- equal:
path: spec.template.spec.imagePullSecrets[0].name
value: afm-adapter-image-pull-secret
- it: should set the imagePull secret - it: should set the imagePull secret
set: set:
imagePullSecret: image-pull-secret imagePullSecret: image-pull-secret
asserts: asserts:
- isKind:
of: Deployment
- equal: - equal:
path: spec.template.spec.imagePullSecrets[0].name path: spec.template.spec.imagePullSecrets[0].name
value: image-pull-secret value: image-pull-secret
- it: should fail tempalte when not set
asserts:
- failedTemplate:
errorMessage: imagePullSecret must be set
\ No newline at end of file
...@@ -22,20 +22,19 @@ ...@@ -22,20 +22,19 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment liveness probe
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: livenessProbe should be disabled by default - it: livenessProbe should be disabled by default
template: deployment.yaml
asserts: asserts:
- notExists: - notExists:
path: spec.template.spec.containers[0].livenessProbe path: spec.template.spec.containers[0].livenessProbe
- it: enable livenessProbe - it: enable livenessProbe
template: deployment.yaml
set: set:
enableLivenessProbe: true enableLivenessProbe: true
asserts: asserts:
......
#
# Copyright (C) 2024 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 deployment container basics
release:
name: eingang-manager
namespace: sh-helm-test
templates:
- templates/deployment.yaml
set:
ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests:
- it: should have correct pod template values
asserts:
- isEmpty:
path: spec.template.spec.dnsConfig
- equal:
path: spec.template.spec.dnsPolicy
value: "ClusterFirst"
- equal:
path: spec.template.spec.restartPolicy
value: "Always"
- equal:
path: spec.template.spec.schedulerName
value: "default-scheduler"
- equal:
path: spec.template.spec.terminationGracePeriodSeconds
value: 30
\ No newline at end of file
...@@ -22,13 +22,14 @@ ...@@ -22,13 +22,14 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment resources
release: release:
name: afm-adapter name: afm-adapter
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: test resources - it: test resources
set: set:
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# unter der Lizenz sind dem Lizenztext zu entnehmen. # unter der Lizenz sind dem Lizenztext zu entnehmen.
# #
suite: test deployment suite: test deployment routing strategy
release: release:
name: intelliform-adapter name: intelliform-adapter
namespace: sh-helm-test namespace: sh-helm-test
...@@ -31,6 +31,7 @@ templates: ...@@ -31,6 +31,7 @@ templates:
set: set:
image.tag: latest image.tag: latest
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: validate default routing values without questions.yaml - it: validate default routing values without questions.yaml
asserts: asserts:
......
...@@ -31,6 +31,7 @@ templates: ...@@ -31,6 +31,7 @@ templates:
set: set:
ozgcloud.environment: test ozgcloud.environment: test
imagePullSecret: image-pull-secret
tests: tests:
- it: should use afm-adapter service account name - it: should use afm-adapter service account name
set: set:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment