diff --git a/alfa-client/apps/info/Jenkinsfile b/alfa-client/apps/info/Jenkinsfile index 5c5b0b390191c696686b1bb470fea9a83eadfb28..2b7619392b6b040108a0e5c81d7ba274cd0bd022 100644 --- a/alfa-client/apps/info/Jenkinsfile +++ b/alfa-client/apps/info/Jenkinsfile @@ -35,30 +35,80 @@ pipeline { script { FAILED_STAGE = env.STAGE_NAME dir('alfa-client') { - sh 'echo "registry=https://nexus.ozg-sh.de/repository/npm-proxy" >> ~/.npmrc' - sh 'echo "//nexus.ozg-sh.de/:_auth=amVua2luczprTSFnNVUhMVQzNDZxWQ==" >> ~/.npmrc' - sh 'npm cache verify' - sh 'npm install' - sh 'npx nx run info:test' - sh 'npx nx run info:test -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && npx sonar-scanner' + withNPM(npmrcConfig: 'npm-nexus-auth') { + sh 'npm cache verify' + sh 'npm install' + sh 'npx nx run info:test' + sh 'npx nx run info:test -- --runInBand --codeCoverage --coverageReporters=lcov --testResultsProcessor=jest-sonar-reporter && npx sonar-scanner' - IMAGE_TAG = generateImageTag() + IMAGE_TAG = generateImageTag() - if (isMasterBranch()) { - IMAGE_TAG = "snapshot-latest" - } - else if (isReleaseBranch()) { - IMAGE_TAG = "latest" + if (isMasterBranch()) { + IMAGE_TAG = "snapshot-latest" + } + else if (isReleaseBranch()) { + IMAGE_TAG = "latest" + } + + loginToDockerRegistry() + + sh "INPUT_TAGS=${IMAGE_TAG} INPUT_IMAGES=docker.ozg-sh.de/info-client-by npx nx container info --configuration=production-by" + sh "INPUT_TAGS=${IMAGE_TAG} INPUT_IMAGES=docker.ozg-sh.de/info-client-sh npx nx container info --configuration=production-sh" } + } + } + } + } - loginToDockerRegistry() + stage('Test, build and deploy info-client HelmChart') { + steps { + script { + FAILED_STAGE = env.STAGE_NAME + HELM_CHART_VERSION = generateHelmChartVersion() + + dir('alfa-client/apps/info') { + sh "./run_helm_test.sh" + + dir('src/main/helm') { + sh "helm package --version=${HELM_CHART_VERSION} ." - sh "INPUT_TAGS=${IMAGE_TAG} INPUT_IMAGES=docker.ozg-sh.de/info-client-by npx nx container info --configuration=production-by" - sh "INPUT_TAGS=${IMAGE_TAG} INPUT_IMAGES=docker.ozg-sh.de/info-client-sh npx nx container info --configuration=production-sh" + deployHelmChart(HELM_CHART_VERSION) + } } } } } + + stage('Trigger Dev Rollout') { + when { + branch 'master' + } + steps { + script { + FAILED_STAGE = env.STAGE_NAME + cloneGitopsRepo() + setNewDevVersion() + pushDevGitopsRepo() + } + } + } + + stage('Trigger Test rollout') { + when { + expression { + isReleaseBranch() + } + } + + steps { + script { + FAILED_STAGE = env.STAGE_NAME + cloneGitopsRepo() + setNewTestVersion() + pushTestGitopsRepo() + } + } + } } post { failure { @@ -71,7 +121,7 @@ pipeline { } } Boolean isReleaseBranch() { - return env.BRANCH_NAME == 'release-admin' + return env.BRANCH_NAME == 'release-info' } String generateImageTag() { @@ -111,24 +161,24 @@ Void setNewTestVersion() { Void setNewGitopsVersion(String environment) { dir("gitops") { - def envFile = "${environment}/application/values/admin-client-values.yaml" + def envFile = "${environment}/application/values/info-client-values.yaml" def envVersions = readYaml file: envFile - envVersions.admin_client.image.tag = IMAGE_TAG - envVersions.admin_client.helm.version = HELM_CHART_VERSION + envVersions.info_client.image.tag = IMAGE_TAG + envVersions.info_client.helm.version = HELM_CHART_VERSION writeYaml file: envFile, data: envVersions, overwrite: true if (hasValuesFileChanged(environment)) { sh "git add ${envFile}" - sh "git commit -m 'jenkins rollout ${environment} admin_client version ${IMAGE_TAG}'" + sh "git commit -m 'jenkins rollout ${environment} info-client version ${IMAGE_TAG}'" } } } Boolean hasValuesFileChanged(String environment) { - return sh (script: "git status | grep '${environment}/application/values/admin-client-values.yaml'", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer + return sh (script: "git status | grep '${environment}/application/values/info-client-values.yaml'", returnStatus: true) == env.SH_SUCCESS_STATUS_CODE as Integer } @@ -161,10 +211,10 @@ String getPackagejsonVersion() { Void deployHelmChart(String helmChartVersion) { withCredentials([usernamePassword(credentialsId: 'jenkins-nexus-login', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD')]){ if (isReleaseBranch()) { - result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps -F file=@admin-client-'''+helmChartVersion+'''.tgz''', returnStdout: true + result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps -F file=@info-client-'''+helmChartVersion+'''.tgz''', returnStdout: true } else { - result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps-snapshot -F file=@admin-client-'''+helmChartVersion+'''.tgz''', returnStdout: true + result = sh script: '''curl -u $USERNAME:$PASSWORD https://nexus.ozg-sh.de/service/rest/v1/components?repository=ozg-base-apps-snapshot -F file=@info-client-'''+helmChartVersion+'''.tgz''', returnStdout: true } if (result != '') { @@ -192,9 +242,9 @@ Boolean isMasterBranch() { Void sendFailureMessage() { def room = '' def data = """{"msgtype":"m.text", \ - "body":"Admin-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${BLUE_OCEAN_URL}", \ + "body":"Info-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: ${env.BUILD_NUMBER} Link: ${BLUE_OCEAN_URL}", \ "format": "org.matrix.custom.html", \ - "formatted_body":"Admin-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}""" + "formatted_body":"Info-Client: Build Failed. Stage: ${FAILED_STAGE} Build-ID: <a href='${BLUE_OCEAN_URL}'>${env.BUILD_NUMBER}</a>"}""" if (isMasterBranch()) { room = "!iQPAvQIiRwRpNOszjw:matrix.ozg-sh.de" diff --git a/alfa-client/apps/info/run_helm_test.sh b/alfa-client/apps/info/run_helm_test.sh new file mode 100755 index 0000000000000000000000000000000000000000..30f96ffa008eada74acd1bbe8ddd6be43ff57019 --- /dev/null +++ b/alfa-client/apps/info/run_helm_test.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e +set -x + +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/**/*test.yaml' . \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/Chart.yaml b/alfa-client/apps/info/src/main/helm/Chart.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ba4b0c6fa149e8fee566a2da9de13280bd85d6e7 --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +name: info-client +version: 0.0.0-MANAGED-BY-JENKINS +description: A Helm chart for Info Client \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/templates/_helpers.tpl b/alfa-client/apps/info/src/main/helm/templates/_helpers.tpl new file mode 100644 index 0000000000000000000000000000000000000000..c18ade6ab9a8a331e10f4fdd1ea422bba776a564 --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/_helpers.tpl @@ -0,0 +1,75 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* error check 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec) */}} +{{/* Namespace */}} +{{- define "app.namespace" -}} +{{- if gt (len (.Release.Namespace)) 63 -}} +{{- fail (printf ".Release.Namespace %s ist zu lang (max. 63 Zeichen)" .Release.Namespace) -}} +{{- end -}} +{{ printf "%s" .Release.Namespace }} +{{- end -}} + +{{/* Chart: Name + Version */}} +{{- define "app.chart" -}} +{{- 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" -}} +{{- 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: info-client +app.kubernetes.io/managed-by: {{ include "app.managedBy" . }} +app.kubernetes.io/part-of: ozgcloud +app.kubernetes.io/version: {{ .Chart.Version }} +helm.sh/chart: {{ include "app.chart" . }} +{{- include "app.matchLabels" . }} +{{- end -}} + +{{- define "app.matchLabels" }} +app.kubernetes.io/name: {{ .Release.Name }} +app.kubernetes.io/namespace: {{ include "app.namespace" . }} +{{- end -}} + +{{- define "app.getBaseDomain" -}} +{{- required "baseDomain muss angegeben sein" .Values.baseDomain }} +{{- end -}} + +{{- define "app.getCustomList" -}} +{{- with (.Values.env).customList -}} +{{- if kindIs "map" . -}} +{{ include "app.dictToList" . }} +{{- else if kindIs "slice" . -}} +{{ . | toYaml }} +{{- end -}} +{{- end -}} +{{- end -}} + +{{- define "app.dictToList" -}} +{{- $customList := list -}} +{{- range $key, $value := . -}} +{{- $customList = append $customList (dict "name" $key "value" $value) }} +{{- end -}} +{{- $customList | toYaml -}} +{{- end -}} + +{{- define "app.getIngressTlsSecretName" -}} +{{- if (.Values.ingress).tlsSecretName -}} +{{ (.Values.ingress).tlsSecretName }} +{{- else -}} +{{ printf "%s-tls" .Release.Name }} +{{- end -}} +{{- end -}} + +{{- define "app.getImageName" -}} +{{- required "image.name muss angegeben sein" .Values.image.name }} +{{- end -}} \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/templates/deployment.yaml b/alfa-client/apps/info/src/main/helm/templates/deployment.yaml new file mode 100644 index 0000000000000000000000000000000000000000..252254878d123c76b5d0e91375a0e7735a04a7ed --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/deployment.yaml @@ -0,0 +1,117 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + namespace: {{ include "app.namespace" . }} + labels: +{{- include "app.defaultLabels" . | indent 4 }} +spec: + progressDeadlineSeconds: 600 + replicas: {{ .Values.replicaCount }} + revisionHistoryLimit: 10 + selector: + matchLabels: +{{- include "app.matchLabels" . | indent 6 }} + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + labels: +{{- include "app.defaultLabels" . | indent 8 }} + spec: + {{- if (.Values.serviceAccount).create }} + serviceAccountName: {{ (.Values.serviceAccount).name }} + {{- end }} + topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchLabels: +{{- include "app.matchLabels" . | indent 12 }} + containers: + - env: + {{- with include "app.getCustomList" . }} +{{ . | indent 8 }} + {{- end }} + image: "{{ .Values.image.repo }}/{{ include "app.getImageName" . }}:{{ .Values.image.tag }}" + imagePullPolicy: Always + name: info-client + ports: + - containerPort: 8080 + name: 8080tcp + protocol: TCP + {{- if not .Values.disableMonitoring }} + - containerPort: 2091 + name: metrics + protocol: TCP + {{- end }} + readinessProbe: + failureThreshold: 3 + httpGet: + path: / + port: 8080 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + startupProbe: + failureThreshold: 10 + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 30 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + {{- if .Values.enableLivenessProbe }} + livenessProbe: + failureThreshold: 3 + httpGet: + path: / + port: 8080 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + {{- end }} + resources: + {{- with .Values.resources }} +{{ toYaml . | indent 10 }} + {{- end }} + securityContext: + allowPrivilegeEscalation: false + privileged: false + readOnlyRootFilesystem: false + runAsNonRoot: true + {{- with (.Values.securityContext).runAsUser }} + runAsUser: {{ . }} + {{- end }} + {{- with (.Values.securityContext).runAsGroup }} + runAsGroup: {{ . }} + {{- end }} + {{- with (.Values.securityContext).capabilities }} + capabilities: +{{ toYaml . | indent 12 }} + {{- end }} + stdin: true + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + tty: true + dnsConfig: {} + dnsPolicy: ClusterFirst + restartPolicy: Always + {{- with .Values.hostAliases }} + hostAliases: +{{ toYaml . | indent 8 }} + {{- end }} + schedulerName: default-scheduler + {{- with .Values.podSecurityContext }} + securityContext: +{{ toYaml . | indent 8 }} + {{- end }} + terminationGracePeriodSeconds: 30 diff --git a/alfa-client/apps/info/src/main/helm/templates/ingress.yaml b/alfa-client/apps/info/src/main/helm/templates/ingress.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9187e9a099202e314d6da3953070112825188ddc --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/ingress.yaml @@ -0,0 +1,37 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + annotations: + {{- with (.Values.ingress).annotations }} +{{ toYaml . | indent 4 }} + {{- end }} + {{- if not (.Values.ingress).disableDefaultCertManager }} + {{- if (.Values.ingress).useStagingCert }} + cert-manager.io/cluster-issuer: letsencrypt-staging + {{- else }} + cert-manager.io/cluster-issuer: letsencrypt-prod + {{- end }} + {{- end }} + name: {{ .Release.Name }} + namespace: {{ include "app.namespace" . }} +spec: + {{- if (.Values.ingress).className }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + rules: + - http: + paths: + - backend: + service: + port: + number: 8080 + name: {{ .Release.Name }} + path: '/' + pathType: Prefix + host: {{ include "app.getBaseDomain" . }} + {{- if not (.Values.ingress).skipTlsSecret }} + tls: + - hosts: + - {{ include "app.getBaseDomain" . }} + secretName: {{ include "app.getIngressTlsSecretName" . }} + {{- end }} \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/templates/network_policy.yaml b/alfa-client/apps/info/src/main/helm/templates/network_policy.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ffeff6844ca8a292d35b4bddab04c299d1b5897a --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/network_policy.yaml @@ -0,0 +1,32 @@ +{{- if not (.Values.networkPolicy).disabled }} +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: network-policy-info-client + namespace: {{ .Release.Namespace }} +spec: + podSelector: + matchLabels: + {{- include "app.matchLabels" . | indent 6 }} + policyTypes: + - Ingress + ingress: + - ports: + - port: 8080 + {{- if not .Values.disableMonitoring }} + - from: + - namespaceSelector: + matchLabels: + name: {{ (.Values.networkPolicy).monitoringNamespace | default "openshift-user-workload-monitoring" }} + ports: + - protocol: TCP + port: 2019 + {{- end }} +{{- with (.Values.networkPolicy).additionalIngressConfigLocal }} +{{ toYaml . | indent 2 }} +{{- end }} +{{- with (.Values.networkPolicy).additionalIngressConfigGlobal }} +{{ toYaml . | indent 2 }} +{{- end }} + +{{- end }} \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/templates/service.yaml b/alfa-client/apps/info/src/main/helm/templates/service.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dece155c89fd323559ce83b95c22f2a0b6021723 --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/service.yaml @@ -0,0 +1,20 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} + namespace: {{ include "app.namespace" . }} + labels: + {{- include "app.defaultLabels" . | indent 4 }} +spec: + type: ClusterIP + ports: + - name: http + port: 8080 + protocol: TCP + {{- if not .Values.disableMonitoring }} + - name: metrics + port: 2019 + protocol: TCP + {{- end }} + selector: + {{- include "app.matchLabels" . | indent 4 }} \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/templates/service_account.yaml b/alfa-client/apps/info/src/main/helm/templates/service_account.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d6495a1db84896420950c605629c9980a7b50560 --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/service_account.yaml @@ -0,0 +1,7 @@ +{{- if (.Values.serviceAccount).create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ (.Values.serviceAccount).name }} + namespace: {{ include "app.namespace" . }} +{{- end }} \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/templates/service_monitor.yaml b/alfa-client/apps/info/src/main/helm/templates/service_monitor.yaml new file mode 100644 index 0000000000000000000000000000000000000000..59af718dec63cd036b2935da0d2e2da059ee1ac8 --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/templates/service_monitor.yaml @@ -0,0 +1,19 @@ +{{- if not .Values.disableMonitoring }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Release.Name }} + namespace: {{ include "app.namespace" . }} + labels: + {{- include "app.defaultLabels" . | indent 4 }} +spec: + endpoints: + - port: metrics + path: /metrics + namespaceSelector: + matchNames: + - {{ include "app.namespace" . }} + selector: + matchLabels: + {{- include "app.matchLabels" . | indent 6 }} +{{- end }} \ No newline at end of file diff --git a/alfa-client/apps/info/src/main/helm/values.yaml b/alfa-client/apps/info/src/main/helm/values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f62c7b061da7a5739e214890f76636992f8225c6 --- /dev/null +++ b/alfa-client/apps/info/src/main/helm/values.yaml @@ -0,0 +1,22 @@ +image: + repo: docker.ozg-sh.de + name: + tag: latest + +replicaCount: 1 + +resources: + limits: + cpu: 150m + memory: 150Mi + requests: + cpu: 50m + memory: 50Mi + +baseDomain: + +disableMonitoring: + +serviceAccount: + create: + name: info-client-service-account \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm-linter-values.yaml b/alfa-client/apps/info/src/test/helm-linter-values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a4b081509be5d987f15d48438fe1e0e101c627af --- /dev/null +++ b/alfa-client/apps/info/src/test/helm-linter-values.yaml @@ -0,0 +1,4 @@ +image: + name: info-client-test + +baseDomain: static.dev.by.ozg-cloud.de \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_63_char_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_63_char_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..137c5b6bad2d9600814eba110dbe990cba62f4fc --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_63_char_test.yaml @@ -0,0 +1,28 @@ +suite: test _helpers functions less then 63 characters +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-client-by +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 info-client-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: {} diff --git a/alfa-client/apps/info/src/test/helm/deployment_container_env_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_container_env_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a3143aabbc8f0c2dd2ef9aa9f02b7186e29a8814 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_container_env_test.yaml @@ -0,0 +1,50 @@ +suite: test deployment container envs +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-client-by +tests: + - it: check customList as list + set: + env: + customList: + - name: my_test_environment_name + value: "A test value" + - name: test_environment + value: "B test value" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: my_test_environment_name + value: "A test value" + - contains: + path: spec.template.spec.containers[0].env + content: + name: test_environment + value: "B test value" + - it: check customList as dict + set: + env: + customList: + my_test_environment_name: "A test value" + test_environment: "B test value" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: my_test_environment_name + value: "A test value" + - contains: + path: spec.template.spec.containers[0].env + content: + name: test_environment + value: "B test value" + - it: check env is empty by default + asserts: + - isEmpty: + path: spec.template.spec.containers[0].env \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_container_image_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_container_image_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..73420b223b1096f00e4782a35cb4a30aa6d4fece --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_container_image_test.yaml @@ -0,0 +1,19 @@ +suite: test deployment image +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +tests: + - it: should faile if image.name is not set + asserts: + - failedTemplate: + errorMessage: image.name muss angegeben sein + - it: should set image + set: + image: + name: info-client-by + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: docker.ozg-sh.de/info-client-by:latest \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_container_ports_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_container_ports_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bdbc611fb087ed1866efcebdeeb7c38fd63fce13 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_container_ports_test.yaml @@ -0,0 +1,32 @@ +suite: test deployment container ports +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-client-by +tests: + - it: should have ports + asserts: + - equal: + path: spec.template.spec.containers[0].ports + value: + - containerPort: 8080 + name: 8080tcp + protocol: TCP + - containerPort: 2091 + name: metrics + protocol: TCP + - it: should not contain metrics ports if monitoring is disabled + set: + disableMonitoring: true + asserts: + - notContains: + path: spec.template.spec.containers[0].ports + content: + containerPort: 2091 + name: metrics + protocol: TCP + any: true \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_container_probes_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_container_probes_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3be3176f7ecfc6a3e0efcaa26d38b47fa2164298 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_container_probes_test.yaml @@ -0,0 +1,56 @@ +suite: test deployment container probes +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-client-by +tests: + - it: should have readinessProbe + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + failureThreshold: 3 + httpGet: + path: / + port: 8080 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + - it: should have startupProbe + asserts: + - equal: + path: spec.template.spec.containers[0].startupProbe + value: + failureThreshold: 10 + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 30 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + - it: should not have livenessProbe + asserts: + - notExists: + path: spec.template.spec.containers[0].livenessProbe + - it: should have livenessProbe + set: + enableLivenessProbe: true + asserts: + - equal: + path: spec.template.spec.containers[0].livenessProbe + value: + failureThreshold: 3 + httpGet: + path: / + port: 8080 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_container_security_context_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_container_security_context_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..8987fcd33a583bc621c3547a87006fe793ab0964 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_container_security_context_test.yaml @@ -0,0 +1,63 @@ +suite: test deployment container security context +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-clinet-by +tests: + - it: check default values + asserts: + - equal: + path: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation + value: false + - equal: + path: spec.template.spec.containers[0].securityContext.privileged + value: false + - equal: + path: spec.template.spec.containers[0].securityContext.readOnlyRootFilesystem + value: false + - equal: + path: spec.template.spec.containers[0].securityContext.runAsNonRoot + value: true + - isNull: + path: spec.template.spec.containers[0].securityContext.runAsUser + - isNull: + path: spec.template.spec.containers[0].securityContext.runAsGroup + - isNull: + path: spec.template.spec.containers[0].securityContext.capabilities + - it: check runAsUser + set: + securityContext.runAsUser: 1000 + asserts: + - equal: + path: spec.template.spec.containers[0].securityContext.runAsUser + value: 1000 + - it: check runAsGroup + set: + securityContext.runAsGroup: 1000 + asserts: + - equal: + path: spec.template.spec.containers[0].securityContext.runAsGroup + value: 1000 + - it: check fsGroup + set: + podSecurityContext.fsGroup: 1000 + asserts: + - equal: + path: spec.template.spec.securityContext.fsGroup + value: 1000 + - it: check capabilities + set: + securityContext: + capabilities: + drop: + - ALL + asserts: + - equal: + path: spec.template.spec.containers[0].securityContext.capabilities + value: + drop: + - ALL \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_container_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_container_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..dde7b56aa83574d0378f6e5712fc8be85f32f310 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_container_test.yaml @@ -0,0 +1,164 @@ +suite: test deployment container +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +tests: + - it: check customList as list + set: + image: + name: info-client-by + env: + customList: + - name: my_test_environment_name + value: "A test value" + - name: test_environment + value: "B test value" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: my_test_environment_name + value: "A test value" + - contains: + path: spec.template.spec.containers[0].env + content: + name: test_environment + value: "B test value" + - it: check customList as dict + set: + image: + name: info-client-by + env: + customList: + my_test_environment_name: "A test value" + test_environment: "B test value" + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: my_test_environment_name + value: "A test value" + - contains: + path: spec.template.spec.containers[0].env + content: + name: test_environment + value: "B test value" + - it: check env is empty by default + set: + image: + name: info-client-by + asserts: + - isEmpty: + path: spec.template.spec.containers[0].env + - it: should faile if image.name is not set + asserts: + - failedTemplate: + errorMessage: image.name muss angegeben sein + - it: should set image + set: + image: + name: info-client-by + asserts: + - equal: + path: spec.template.spec.containers[0].image + value: docker.ozg-sh.de/info-client-by:latest + - it: should have ports + set: + image: + name: info-client-by + asserts: + - equal: + path: spec.template.spec.containers[0].ports + value: + - containerPort: 8080 + name: 8080tcp + protocol: TCP + - containerPort: 2091 + name: metrics + protocol: TCP + - it: should not contain metrics ports if monitoring is disabled + set: + image: + name: info-client-by + disableMonitoring: true + asserts: + - notContains: + path: spec.template.spec.containers[0].ports + content: + containerPort: 2091 + name: metrics + protocol: TCP + any: true + - it: should have readinessProbe + set: + image: + name: info-client-by + asserts: + - equal: + path: spec.template.spec.containers[0].readinessProbe + value: + failureThreshold: 3 + httpGet: + path: / + port: 8080 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + - it: should have startupProbe + set: + image: + name: info-client-by + asserts: + - equal: + path: spec.template.spec.containers[0].startupProbe + value: + failureThreshold: 10 + httpGet: + path: / + port: 8080 + scheme: HTTP + initialDelaySeconds: 30 + periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 5 + - it: should not have livenessProbe + set: + image: + name: info-client-by + asserts: + - notExists: + path: spec.template.spec.containers[0].livenessProbe + - it: should have livenessProbe + set: + image: + name: info-client-by + enableLivenessProbe: true + asserts: + - equal: + path: spec.template.spec.containers[0].livenessProbe + value: + failureThreshold: 3 + httpGet: + path: / + port: 8080 + scheme: HTTP + periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 3 + - it: should have defautl resources + set: + image: + name: info-client-by + asserts: + - equal: + path: spec.template.spec.containers[0].resources + value: + limits: + cpu: 150m + memory: 150Mi + requests: + cpu: 50m + memory: 50Mi diff --git a/alfa-client/apps/info/src/test/helm/deployment_pod_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_pod_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..ea8769a3bc225a9d995e4ab20f70a134c9f3ef07 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_pod_test.yaml @@ -0,0 +1,114 @@ +suite: test pod deployment +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-client-by +tests: + - it: validate kind + asserts: + - isKind: + of: Deployment + - it: validate apiVersion + asserts: + - isAPIVersion: + of: "apps/v1" + - it: validate default name + asserts: + - equal: + path: metadata.name + value: info-client + - it: validate default namespace + asserts: + - equal: + path: metadata.namespace + value: by-helm-test + - it: should have default labels + asserts: + - equal: + path: metadata.labels + value: + app.kubernetes.io/instance: info-client + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: ozgcloud + app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS + helm.sh/chart: info-client-0.0.0-MANAGED-BY-JENKINS + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: should have default replicaCount + asserts: + - equal: + path: spec.replicas + value: 1 + - it: should set replicaCount + set: + replicaCount: 2 + asserts: + - equal: + path: spec.replicas + value: 2 + - it: should have match labels + asserts: + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: template should have default labels + asserts: + - equal: + path: spec.template.metadata.labels + value: + app.kubernetes.io/instance: info-client + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: ozgcloud + app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS + helm.sh/chart: info-client-0.0.0-MANAGED-BY-JENKINS + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: topologySpreadConstraints should have default matchLabels + asserts: + - equal: + path: spec.template.spec.topologySpreadConstraints[0].labelSelector.matchLabels + value: + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + + - it: should not set hostAliases + asserts: + - isNull: + path: spec.template.spec.hostAliases + - it: should set hostAliases + set: + hostAliases: + - ip: "127.0.0.1" + hostname: + - "eins" + - "zwei" + asserts: + - contains: + path: spec.template.spec.hostAliases + content: + ip: "127.0.0.1" + hostname: + - "eins" + - "zwei" + - it: should not set pod securityContext + asserts: + - isNull: + path: spec.template.spec.securityContext + - it: should set pod securityContext + set: + podSecurityContext: + capabilities: + drop: + - ALL + asserts: + - equal: + path: spec.template.spec.securityContext.capabilities + value: + drop: + - ALL \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/deployment_service_account_test.yaml b/alfa-client/apps/info/src/test/helm/deployment_service_account_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..4d78ecbc5b99c17ff4ad51a8583bda88c77d66ed --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/deployment_service_account_test.yaml @@ -0,0 +1,31 @@ +suite: test deployment service account +release: + name: info-client + namespace: by-helm-test +templates: + - templates/deployment.yaml +set: + image: + name: info-client-by +tests: + - it: should use service account with default name + set: + serviceAccount: + create: true + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: info-client-service-account + - it: should use service account with name + set: + serviceAccount: + create: true + name: test-service-account + asserts: + - equal: + path: spec.template.spec.serviceAccountName + value: test-service-account + - it: should not use service account + asserts: + - isNull: + path: spec.template.spec.serviceAccountName \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/ingress_test.yaml b/alfa-client/apps/info/src/test/helm/ingress_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..bdf028becd7e78d3f660b753bcf4e62ceace1378 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/ingress_test.yaml @@ -0,0 +1,144 @@ +suite: test ingress +release: + name: info-client + namespace: by-helm-test +templates: + - templates/ingress.yaml +tests: + - it: validate kind + set: + baseDomain: static.test.ozgcloud.de + asserts: + - isKind: + of: Ingress + - it: validate apiVersion + set: + baseDomain: static.test.ozgcloud.de + asserts: + - isAPIVersion: + of: "networking.k8s.io/v1" + - it: validate default name + set: + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: metadata.name + value: info-client + - it: validate default namespace + set: + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: metadata.namespace + value: by-helm-test + - it: should use default letsencrypt-prod cluster-issuer + set: + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: metadata.annotations["cert-manager.io/cluster-issuer"] + value: letsencrypt-prod + - it: should use letsencrypt-staging cluster-issuer + set: + ingress: + useStagingCert: true + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: metadata.annotations["cert-manager.io/cluster-issuer"] + value: letsencrypt-staging + - it: should use letsencrypt-prod cluster-issuer + set: + ingress: + useStagingCert: false + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: metadata.annotations["cert-manager.io/cluster-issuer"] + value: letsencrypt-prod + - it: should disable default cert-manager + set: + ingress: + disableDefaultCertManager: true + baseDomain: static.test.ozgcloud.de + asserts: + - notExists: + path: metadata.annotations["cert-manager.io/cluster-issuer"] + - it: should set ingress annotation + set: + ingress: + annotations: + test: test-annotation + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: metadata.annotations.test + value: test-annotation + - it: should not set ingressClassName + set: + baseDomain: static.test.ozgcloud.de + asserts: + - isNull: + path: spec.ingressClassName + - it: should set ingressClassName + set: + ingress: + className: nginx + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: spec.ingressClassName + value: nginx + - it: validate rules + set: + baseDomain: static.test.ozgcloud.de + asserts: + - contains: + path: spec.rules + content: + http: + paths: + - backend: + service: + port: + number: 8080 + name: info-client + path: '/' + pathType: Prefix + host: static.test.ozgcloud.de + - it: should fail if baseDomain is not set + asserts: + - failedTemplate: + errorMessage: baseDomain muss angegeben sein + - it: should generate tls secret name + set: + baseDomain: static.test.ozgcloud.de + asserts: + - equal: + path: spec.tls[0].secretName + value: info-client-tls + - it: should set tls secret name + set: + baseDomain: static.test.ozgcloud.de + ingress: + tlsSecretName: test-secretname-tls + asserts: + - equal: + path: spec.tls[0].secretName + value: test-secretname-tls + - it: should set tls host + set: + baseDomain: static.test.ozgcloud.de + asserts: + - contains: + path: spec.tls[0].hosts + content: + static.test.ozgcloud.de + - it: should not contain tls settings + set: + baseDomain: static.test.ozgcloud.de + ingress: + skipTlsSecret: true + asserts: + - notExists: + path: spec.tls \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/service_account_test.yaml b/alfa-client/apps/info/src/test/helm/service_account_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..9cb8e8d902ed1418e0911d658119c80e08f51d20 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/service_account_test.yaml @@ -0,0 +1,41 @@ +suite: test serviceAccount +release: + name: info-client + namespace: by-helm-test +templates: + - templates/service_account.yaml +tests: + - it: validate kind + set: + serviceAccount: + create: true + asserts: + - isKind: + of: ServiceAccount + - it: validate apiVersion + set: + serviceAccount: + create: true + asserts: + - isAPIVersion: + of: "v1" + - it: validate default name + set: + serviceAccount: + create: true + asserts: + - equal: + path: metadata.name + value: info-client-service-account + - it: validate default namespace + set: + serviceAccount: + create: true + asserts: + - equal: + path: metadata.namespace + value: by-helm-test + - it: should not create ServiceAccount + asserts: + - hasDocuments: + count: 0 \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/service_monitor_test.yaml b/alfa-client/apps/info/src/test/helm/service_monitor_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..78878d5eedd32475e61169653d33b9363c9ca9c5 --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/service_monitor_test.yaml @@ -0,0 +1,63 @@ +suite: test service monitor +release: + name: info-client + namespace: by-helm-test +templates: + - templates/service_monitor.yaml +tests: + - it: validate kind + asserts: + - isKind: + of: ServiceMonitor + - it: validate apiVersion + asserts: + - isAPIVersion: + of: "monitoring.coreos.com/v1" + - it: validate default name + asserts: + - equal: + path: metadata.name + value: info-client + - it: validate default namespace + asserts: + - equal: + path: metadata.namespace + value: by-helm-test + - it: should have default labels + asserts: + - equal: + path: metadata.labels + value: + app.kubernetes.io/instance: info-client + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: ozgcloud + app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS + helm.sh/chart: info-client-0.0.0-MANAGED-BY-JENKINS + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: should have endpoint + asserts: + - contains: + path: spec.endpoints + content: + port: metrics + path: /metrics + - it: should have namespaceSelector + asserts: + - contains: + path: spec.namespaceSelector.matchNames + content: + by-helm-test + - it: should have default matchLabels + asserts: + - equal: + path: spec.selector.matchLabels + value: + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: should not create ServiceMonitor if monitoring is disabled + set: + disableMonitoring: true + asserts: + - hasDocuments: + count: 0 \ No newline at end of file diff --git a/alfa-client/apps/info/src/test/helm/service_test.yaml b/alfa-client/apps/info/src/test/helm/service_test.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5e80dc48031d89763cfaeb16751364b7866fb6ac --- /dev/null +++ b/alfa-client/apps/info/src/test/helm/service_test.yaml @@ -0,0 +1,75 @@ +suite: test service +release: + name: info-client + namespace: by-helm-test +templates: + - templates/service.yaml +tests: + - it: validate kind + asserts: + - isKind: + of: Service + - it: validate apiVersion + asserts: + - isAPIVersion: + of: "v1" + - it: validate default name + asserts: + - equal: + path: metadata.name + value: info-client + - it: validate default namespace + asserts: + - equal: + path: metadata.namespace + value: by-helm-test + - it: should have default labels + asserts: + - equal: + path: metadata.labels + value: + app.kubernetes.io/instance: info-client + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: ozgcloud + app.kubernetes.io/version: 0.0.0-MANAGED-BY-JENKINS + helm.sh/chart: info-client-0.0.0-MANAGED-BY-JENKINS + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: should have default selector + asserts: + - equal: + path: spec.selector + value: + app.kubernetes.io/name: info-client + app.kubernetes.io/namespace: by-helm-test + - it: validate service type + asserts: + - equal: + path: spec.type + value: ClusterIP + - it: should include http port + asserts: + - contains: + path: spec.ports + content: + name: http + port: 8080 + protocol: TCP + - it: should include metrics port + asserts: + - contains: + path: spec.ports + content: + name: metrics + port: 2019 + protocol: TCP + - it: should not include metrics port if monitoring is disabled + set: + disableMonitoring: true + asserts: + - notContains: + path: spec.ports + content: + name: metrics + port: 2019 + protocol: TCP \ No newline at end of file diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 6a6605eec6fa1436022ef090c6bb235b1b4d7c49..57682225e76d0e7f3d049de49ec1e08d9b66cc4e 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -121,11 +121,8 @@ spec: - name: ozgcloud_feature_collaborationEnabled value: {{ ((.Values.ozgcloud).feature).collaborationEnabled | quote }} {{- end }} - {{- if (.Values.ozgcloud).barrierefreiheitUrl }} - name: ozgcloud_barrierefreiheitUrl - value: {{ (.Values.ozgcloud).barrierefreiheitUrl }} - {{- end }} - + value: {{ required "ozgcloud.barrierefreiheitUrl muss angegeben sein" (.Values.ozgcloud).barrierefreiheitUrl }} image: "{{ .Values.image.repo }}/{{ .Values.image.name }}:{{ coalesce (.Values.image).tag "latest" }}" imagePullPolicy: Always name: alfa diff --git a/src/test/helm-linter-values.yaml b/src/test/helm-linter-values.yaml index 921400e84cc132e5bf51df4e7f60aa275dbbc2da..ef1e815825384e1a8704b3f950d4d753c94bf190 100644 --- a/src/test/helm-linter-values.yaml +++ b/src/test/helm-linter-values.yaml @@ -28,6 +28,7 @@ ozgcloud: bundesland: sh bezeichner: helm environment: test + barrierefreiheitUrl: http://barrierefreiheit.lint.url networkPolicy: ssoPublicIp: 51.89.117.53/32 diff --git a/src/test/helm/deployment_63_char_test.yaml b/src/test/helm/deployment_63_char_test.yaml index a4bde43d1ed6c2c363bcc692aa6b7e499408c5d3..28fa4858c874ef7f6a783a6d5ecadb9666ab797a 100644 --- a/src/test/helm/deployment_63_char_test.yaml +++ b/src/test/helm/deployment_63_char_test.yaml @@ -37,7 +37,7 @@ set: environment: test bundesland: sh bezeichner: helm - + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local baseUrl: test.company.local diff --git a/src/test/helm/deployment_archive_manager_address_env_test.yaml b/src/test/helm/deployment_archive_manager_address_env_test.yaml index 148184f0fae94370660e8f49ba6caa74b9182653..62c21c0178121e18e317b25c107785fe6bc86a74 100644 --- a/src/test/helm/deployment_archive_manager_address_env_test.yaml +++ b/src/test/helm/deployment_archive_manager_address_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_bindings_test.yaml b/src/test/helm/deployment_bindings_test.yaml index 5791677f19fd46120462030067519ee947448c74..1a97acbf75dfc76a29657b0e031ff3c72a3e819c 100644 --- a/src/test/helm/deployment_bindings_test.yaml +++ b/src/test/helm/deployment_bindings_test.yaml @@ -33,6 +33,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local baseUrl: test.company.local diff --git a/src/test/helm/deployment_collaboration_env_test.yaml b/src/test/helm/deployment_collaboration_env_test.yaml index aa8eef87179703713d05b570b31285c099510bc0..ba02d181e1dc7319c84f18e0f999eb88b600d265 100644 --- a/src/test/helm/deployment_collaboration_env_test.yaml +++ b/src/test/helm/deployment_collaboration_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret @@ -87,14 +88,4 @@ tests: path: spec.template.spec.containers[0].env content: name: grpc_client_zufi-manager_negotiationType - value: TLS - - it: should have barrierefreiheitUrl - set: - ozgcloud: - barrierefreiheitUrl: http://barrierefreiheit.url - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: ozgcloud_barrierefreiheitUrl - value: http://barrierefreiheit.url \ No newline at end of file + value: TLS \ No newline at end of file diff --git a/src/test/helm/deployment_collaboration_manager_address_env_test.yaml b/src/test/helm/deployment_collaboration_manager_address_env_test.yaml index d5b281eb44b0a152bad1bc5c37c693da23959dbe..2d1d4f2ce1668ebca72e9ea166c0e379584d31fd 100644 --- a/src/test/helm/deployment_collaboration_manager_address_env_test.yaml +++ b/src/test/helm/deployment_collaboration_manager_address_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_config_client_env_test.yaml b/src/test/helm/deployment_config_client_env_test.yaml index 4576ce30e68b2150a65c958b073b684567846f75..22160f51c47ae09585a6a9ec76895d536d53cd6c 100644 --- a/src/test/helm/deployment_config_client_env_test.yaml +++ b/src/test/helm/deployment_config_client_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_customList_env_test.yaml b/src/test/helm/deployment_customList_env_test.yaml index 12d891305470eb196bc7da3d68a09461e883f46b..747718c3086265f3f7fa0279f1be4f3cbd16445e 100644 --- a/src/test/helm/deployment_customList_env_test.yaml +++ b/src/test/helm/deployment_customList_env_test.yaml @@ -31,6 +31,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_defaults_affinity_test.yaml b/src/test/helm/deployment_defaults_affinity_test.yaml index 10518783e34f874d4b9f40270b9795d6ce7f8ce0..f6f74091d43288639d332c800f4076fc857ca4ee 100644 --- a/src/test/helm/deployment_defaults_affinity_test.yaml +++ b/src/test/helm/deployment_defaults_affinity_test.yaml @@ -33,6 +33,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local baseUrl: test.company.local diff --git a/src/test/helm/deployment_defaults_env_test.yaml b/src/test/helm/deployment_defaults_env_test.yaml index 2ae7c0e36565b549e69d1f87d9a467e69d2d5e10..8c1ec32ef046e2ca9b86757199a9957e77eb3bba 100644 --- a/src/test/helm/deployment_defaults_env_test.yaml +++ b/src/test/helm/deployment_defaults_env_test.yaml @@ -41,6 +41,8 @@ tests: - it: check default values set: usermanagerName: user-manager + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - isKind: of: Deployment @@ -68,6 +70,8 @@ tests: - it: should have service binding root set: usermanagerName: user-manager + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -84,6 +88,7 @@ tests: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -97,6 +102,7 @@ tests: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url vorgang: bescheid: - formEngineName: AFM @@ -128,6 +134,8 @@ tests: - it: should set user-manager negotiationType plaintext set: userManager.grpcClientNegotiationType: PLAINTEXT + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -136,6 +144,9 @@ tests: value: PLAINTEXT - it: should contain default user-manager negotiationType tls + set: + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -146,6 +157,8 @@ tests: - it: should set vorgang-manager negotiationType plaintext set: vorgangManager.grpcClientNegotiationType: PLAINTEXT + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -154,6 +167,9 @@ tests: value: PLAINTEXT - it: should contain default vorgang-manager negotiationType tls + set: + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -163,6 +179,8 @@ tests: - it: should set collaboration-manager negotiationType plaintext set: collaborationManager.grpcClientNegotiationType: PLAINTEXT + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -171,6 +189,9 @@ tests: value: PLAINTEXT - it: should contain default collaboration-manager negotiationType tls + set: + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -181,6 +202,8 @@ tests: - it: should set archive-manager negotiationType plaintext set: archiveManager.grpcClientNegotiationType: PLAINTEXT + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env @@ -189,9 +212,28 @@ tests: value: PLAINTEXT - it: should contain default archive-manager negotiationType tls + set: + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - contains: path: spec.template.spec.containers[0].env content: name: grpc_client_archive-manager_negotiationType value: TLS + + - it: should set barrierefreiheitUrl + set: + ozgcloud: + barrierefreiheitUrl: http://barrierefreiheit.test.url + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: ozgcloud_barrierefreiheitUrl + value: http://barrierefreiheit.test.url + + - it: should fail without barrierefreiheitUrl + asserts: + - failedTemplate: + errorMessage: ozgcloud.barrierefreiheitUrl muss angegeben sein \ No newline at end of file diff --git a/src/test/helm/deployment_defaults_labels_test.yaml b/src/test/helm/deployment_defaults_labels_test.yaml index 2559f70d29f9bb6f397ddbe71d2235022e98e6f4..4a173586663da27ef10943810af89033747cc021 100644 --- a/src/test/helm/deployment_defaults_labels_test.yaml +++ b/src/test/helm/deployment_defaults_labels_test.yaml @@ -35,6 +35,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_defaults_spec_containers_health_test.yaml b/src/test/helm/deployment_defaults_spec_containers_health_test.yaml index 40588247baeae6a9a7e8370277436793e25160b6..b794b72cdcbdca2426a579b5369c4716639d2967 100644 --- a/src/test/helm/deployment_defaults_spec_containers_health_test.yaml +++ b/src/test/helm/deployment_defaults_spec_containers_health_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_defaults_spec_containers_securityContext_test.yaml b/src/test/helm/deployment_defaults_spec_containers_securityContext_test.yaml index b9ef1310d667be4a1061647245b900f0054a9747..76c0fb55c3a19cb36a101657f7d75dd5e8851788 100644 --- a/src/test/helm/deployment_defaults_spec_containers_securityContext_test.yaml +++ b/src/test/helm/deployment_defaults_spec_containers_securityContext_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_defaults_spec_containers_test.yaml b/src/test/helm/deployment_defaults_spec_containers_test.yaml index b427a8127a9122181724d8268ef15b61272887e0..4a09b1cdef7539b6d4fb44a53d0d02bf2df30a9c 100644 --- a/src/test/helm/deployment_defaults_spec_containers_test.yaml +++ b/src/test/helm/deployment_defaults_spec_containers_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_defaults_sso_env_test.yaml b/src/test/helm/deployment_defaults_sso_env_test.yaml index efe4bca4af37ac0bfe89b54d26b89d881f281cc7..e64213f66ec1af7f2bb97626431513ba23c622ca 100644 --- a/src/test/helm/deployment_defaults_sso_env_test.yaml +++ b/src/test/helm/deployment_defaults_sso_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml b/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml index 4b99323e45f0e350827d4301e98f8bb16f15bffb..f89897b0503e14346d0b518166829067209ade5c 100644 --- a/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml +++ b/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_host_aliases_test.yaml b/src/test/helm/deployment_host_aliases_test.yaml index d4dc00463a9cfbf2e0c6c4b628c49702f53e2f30..42caa76552fc17d74de41b6b9a344180d9005837 100644 --- a/src/test/helm/deployment_host_aliases_test.yaml +++ b/src/test/helm/deployment_host_aliases_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_imageTag_test.yaml b/src/test/helm/deployment_imageTag_test.yaml index 65779921336b3f6f7ae80a69b1b6f7aa46f5e796..883f93ea580f320165c1a655b70fbd5d64fca0a4 100644 --- a/src/test/helm/deployment_imageTag_test.yaml +++ b/src/test/helm/deployment_imageTag_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_imagepull_secret_test.yaml b/src/test/helm/deployment_imagepull_secret_test.yaml index 9fd5ab7461eac571175ba26982b073a8a2e9b870..3a7972b0fc3f59305aabef90e3f359b81f09a0d7 100644 --- a/src/test/helm/deployment_imagepull_secret_test.yaml +++ b/src/test/helm/deployment_imagepull_secret_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local tests: diff --git a/src/test/helm/deployment_liveness_probe_test.yaml b/src/test/helm/deployment_liveness_probe_test.yaml index 1957004a408a64cdfd52da9ce636c3f04fb180e5..78f9912ff33fa920866124af06f5bf35bb00d353 100644 --- a/src/test/helm/deployment_liveness_probe_test.yaml +++ b/src/test/helm/deployment_liveness_probe_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_pod_default_spec_values_test.yaml b/src/test/helm/deployment_pod_default_spec_values_test.yaml index bed9ec81b4b182a610457df9d83760ae65782a3e..32ae31e9d60ae995e8b39526c54876fa063e17fc 100644 --- a/src/test/helm/deployment_pod_default_spec_values_test.yaml +++ b/src/test/helm/deployment_pod_default_spec_values_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_realm_name_length_test.yaml b/src/test/helm/deployment_realm_name_length_test.yaml index 8115f8e5fa107a3073d2def54eef1407a4069082..be7f37f6581fcd1a8f6585b4e5328aec2e28328c 100644 --- a/src/test/helm/deployment_realm_name_length_test.yaml +++ b/src/test/helm/deployment_realm_name_length_test.yaml @@ -36,6 +36,7 @@ tests: bezeichner: test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 environment: test bundesland: by + barrierefreiheitUrl: http://barrierefreiheit.test.url asserts: - failedTemplate: errorMessage: ozgcloud.bezeichner test1234567890123123456789012345678901234567890123456789012345678901234567890123456789012345678904567890 ist zu lang (max. 46 Zeichen) \ No newline at end of file diff --git a/src/test/helm/deployment_resources_test.yaml b/src/test/helm/deployment_resources_test.yaml index 6c19df3b7eb7b3b6e41afaff0d543cb66cc27cb3..ced5244c8602a69e86f9a68a511422c851422ab3 100644 --- a/src/test/helm/deployment_resources_test.yaml +++ b/src/test/helm/deployment_resources_test.yaml @@ -33,6 +33,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_springProfile_env_test.yaml b/src/test/helm/deployment_springProfile_env_test.yaml index 9e66c48cc890a76a4d96011d51427b0085256a2b..075e2d7b3fb0837ee5041da019c973c093dc6732 100644 --- a/src/test/helm/deployment_springProfile_env_test.yaml +++ b/src/test/helm/deployment_springProfile_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_usermanager_address_env_test.yaml b/src/test/helm/deployment_usermanager_address_env_test.yaml index 7c4e9b66ace02f0346e9c80a5a55b25e7b4dcbbb..fdcd6d45a6de7deed49c9d1fe25bf909d157ab09 100644 --- a/src/test/helm/deployment_usermanager_address_env_test.yaml +++ b/src/test/helm/deployment_usermanager_address_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deployment_vorgang_manager_address_env_test.yaml b/src/test/helm/deployment_vorgang_manager_address_env_test.yaml index 9f6f6aee7a4502e949a8e228beab67705869e8e0..905ae5162abb166d730d410a4813afbf5b155c3f 100644 --- a/src/test/helm/deployment_vorgang_manager_address_env_test.yaml +++ b/src/test/helm/deployment_vorgang_manager_address_env_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret diff --git a/src/test/helm/deyploment_general_value_and_default_spec_test.yaml b/src/test/helm/deyploment_general_value_and_default_spec_test.yaml index cc5d2b373dfb5852c6154e0496d68c8f11283f71..b22a8c5ec095bfb0c7985665f1baab40c492ce91 100644 --- a/src/test/helm/deyploment_general_value_and_default_spec_test.yaml +++ b/src/test/helm/deyploment_general_value_and_default_spec_test.yaml @@ -34,6 +34,7 @@ set: environment: test bundesland: sh bezeichner: helm + barrierefreiheitUrl: http://barrierefreiheit.test.url sso: serverUrl: https://sso.company.local imagePullSecret: image-pull-secret