diff --git a/Jenkinsfile b/Jenkinsfile index b80266876dc2f1f182b1f0c2033b82fe1ca58ae2..ab5e5c0dbc7945dc809eb9a28d18977fc9ff0d0b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -195,7 +195,7 @@ pipeline { dir('src/main/helm') { sh "helm lint -f test-values.yaml" - sh "helm unittest -f '../../test/helm/*.yaml' ." + sh "helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ." sh "helm package --version=${HELM_CHART_VERSION} ." @@ -467,7 +467,7 @@ Void editEnvironemntVersion(String stage, String imageTag, Boolean isEa, String devVersions.values.pluto.put('env', ['overrideSpringProfiles': overrideSpringProfiles]) devVersions.versions.goofy.image.tag = imageTag - devVersions.charts.goofy.version = chartVersion + // devVersions.charts.goofy.version = chartVersion writeYaml file: editFile, data: devVersions, overwrite: true } @@ -795,7 +795,7 @@ Void setNewGoofyProvisioningVersion(String environment) { def envVersions = readYaml file: envFile envVersions.versions.goofy.image.tag = IMAGE_TAG - envVersions.charts.goofy.version = HELM_CHART_VERSION + // envVersions.charts.goofy.version = HELM_CHART_VERSION writeYaml file: envFile, data: envVersions, overwrite: true } diff --git a/src/main/helm/templates/_helpers.tpl b/src/main/helm/templates/_helpers.tpl index 8000fc888b34569c25046bd8c653401a913cd144..d647ca7a1521c3434a8e15ec0621e499735718a5 100644 --- a/src/main/helm/templates/_helpers.tpl +++ b/src/main/helm/templates/_helpers.tpl @@ -55,11 +55,7 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- end -}} {{- define "app.kop_user-manager_url" -}} -{{- if eq (include "app.kopEnvironment" . ) "prod" -}} -{{ printf "https://%s-%s.ozg-sh.de" (include "app.kopBezeichner" .) .Values.usermanagerName }} -{{- else -}} -{{ printf "https://%s-%s.%s.ozg-sh.de" (include "app.kopBezeichner" .) .Values.usermanagerName (include "app.kopEnvironment" . ) }} -{{- end -}} +{{ printf "https://%s-%s.%s" (include "app.kopBezeichner" .) .Values.usermanagerName .Values.baseUrl }} {{- end -}} {{- define "app.kop_user-manager_internalurl" -}} @@ -72,11 +68,6 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- end }} {{- end }} -{{/* --- region keycoak --- */}} -{{/* namespace sh-kiel-dev means <bundesland>-<name>-<level> */}} -{{/* depending on level the server url is sso.dev.ozg-sh.de or sso.ozg-sh.de */}} -{{/* values can be overwritten */}} - {{- define "app.kopBundesland" -}} {{- required "Bundesland muss angegeben sein" (.Values.kop).bundesland }} {{- end -}} @@ -109,25 +100,11 @@ app.kubernetes.io/namespace: {{ include "app.namespace" . }} {{- end -}} {{- define "app.ssoServerUrl" -}} -{{- if (.Values.sso).serverUrl -}} {{- printf "%s" .Values.sso.serverUrl -}} -{{- else if eq (include "app.kopEnvironment" . ) "dev" -}} -{{ printf "https://sso.dev.ozg-sh.de" }} -{{- else if eq (include "app.kopEnvironment" . ) "test" -}} -{{ printf "https://sso.test.ozg-sh.de" }} -{{- else -}} -{{ printf "https://sso.ozg-sh.de" }} -{{- end -}} {{- end -}} {{- define "app.baseUrl" -}} -{{- if .Values.host -}} -{{- printf "%s" .Values.host -}} -{{- else if eq (include "app.kopEnvironment" . ) "prod" -}} -{{ printf "https://%s.ozg-sh.de" (include "app.kopBezeichner" .) }} -{{- else -}} -{{ printf "https://%s.%s.ozg-sh.de" (include "app.kopBezeichner" .) (include "app.kopEnvironment" . ) }} -{{- end -}} +{{ printf "https://%s.%s" (include "app.kopBezeichner" .) .Values.baseUrl }} {{- end -}} {{- define "app.keycloakClientId" -}} diff --git a/src/main/helm/templates/ingress.yaml b/src/main/helm/templates/ingress.yaml index 9512154b91be62b4fdb87c0c7e4e3ebe025520b3..aad2383284668d63c9f6aff03c2dd5b509f5c5a3 100644 --- a/src/main/helm/templates/ingress.yaml +++ b/src/main/helm/templates/ingress.yaml @@ -1,12 +1,14 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - {{- with .Values.ingressAnnotations }} - annotations: {{- toYaml . | nindent 4 }} - {{- end }} + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod name: {{ include "app.name" . }} namespace: {{ include "app.namespace" . }} spec: + {{- if ne (.Values).cluster_env "dataport"}} + ingressClassName: nginx + {{- end }} rules: - http: paths: @@ -20,4 +22,7 @@ spec: host: {{ trimPrefix "https://" ( include "app.baseUrl" . ) }} tls: - hosts: - - {{ trimPrefix "https://" ( include "app.baseUrl" . ) }} \ No newline at end of file + - {{ trimPrefix "https://" ( include "app.baseUrl" . ) }} + {{- if ne (.Values).cluster_env "dataport" }} + secretName: {{ .Values.kop.bezeichner }}-{{ include "app.name" . }}-tls + {{- end }} \ No newline at end of file diff --git a/src/main/helm/test-values.yaml b/src/main/helm/test-values.yaml index a87a415fc8ed01c0b27cc7b9715a8dea592b59c0..3e6e8838ebd64f7adeea173912c42f17096fe4b4 100644 --- a/src/main/helm/test-values.yaml +++ b/src/main/helm/test-values.yaml @@ -2,6 +2,3 @@ kop: bundesland: sh bezeichner: helm environment: test - -sso: - apiPassword: test1234 diff --git a/src/main/helm/values.yaml b/src/main/helm/values.yaml index 510d062f849cf2a0fb3ede101153e4e7eeda06d6..6ee6822220f04aee79161341e13cc4f0619d80fd 100644 --- a/src/main/helm/values.yaml +++ b/src/main/helm/values.yaml @@ -1,3 +1,10 @@ +cluster_env: "" + +baseUrl: test.sh.ozg-cloud.de + +sso: + serverUrl: https://sso.sh.ozg-cloud.de + imageCredentials: registry: docker.ozg-sh.de username: kop @@ -11,11 +18,6 @@ image: replicaCount: 2 # [default: 2] -ingressAnnotations: - kubernetes.io/ingress.class: traefik - traefik.ingress.kubernetes.io/router.entrypoints: websecure - traefik.ingress.kubernetes.io/router.tls: "true" - usermanagerName: user-manager # env: @@ -45,4 +47,4 @@ usermanagerName: user-manager # kop: # bundesland: sh # bezeichner: kiel -# environment: dev \ No newline at end of file +# environment: dev diff --git a/src/test/helm/deployment_defaults_affinity_test.yaml b/src/test/helm/deployment_defaults_affinity_test.yaml index d12e99027345cb0bf82c22280f9297c8273ce604..c9c4c403f9221016921f768a5c9c1bb55e1a2c0e 100644 --- a/src/test/helm/deployment_defaults_affinity_test.yaml +++ b/src/test/helm/deployment_defaults_affinity_test.yaml @@ -6,11 +6,6 @@ templates: - templates/deployment.yaml tests: - it: should work - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment diff --git a/src/test/helm/deployment_defaults_annotaion_test.yaml b/src/test/helm/deployment_defaults_annotaion_test.yaml index f339eaea438f903c6f1f3aa1d3bfec8e1bcf2f6f..e1da0a6b535d5882c61771dc8bbdb0f32705da27 100644 --- a/src/test/helm/deployment_defaults_annotaion_test.yaml +++ b/src/test/helm/deployment_defaults_annotaion_test.yaml @@ -5,20 +5,16 @@ release: templates: - templates/ingress.yaml tests: - - it: check ingress annotaions if traefik v2 - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test + - it: check ingress annotaions for nginx asserts: - isKind: of: Ingress - equal: - path: metadata.annotations.[kubernetes.io/ingress.class] - value: traefik + path: metadata.annotations.[cert-manager.io/cluster-issuer] + value: letsencrypt-prod - equal: - path: metadata.annotations.[traefik.ingress.kubernetes.io/router.entrypoints] - value: websecure + path: spec.ingressClassName + value: nginx - equal: - path: metadata.annotations.[traefik.ingress.kubernetes.io/router.tls] - value: "true" \ No newline at end of file + path: spec.tls[0].secretName + value: helm-goofy-tls diff --git a/src/test/helm/deployment_defaults_env_test.yaml b/src/test/helm/deployment_defaults_env_test.yaml index 02c38fad69008a0604b9e12cd99c5afa5383ac60..574a00435bef6d3bbbd33f4731156c78666399cf 100644 --- a/src/test/helm/deployment_defaults_env_test.yaml +++ b/src/test/helm/deployment_defaults_env_test.yaml @@ -1,16 +1,11 @@ suite: test deployment release: name: goofy - namespace: sh-helm-prod + namespace: sh-helm-test templates: - templates/deployment.yaml tests: - it: check default values - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: prod - sso.apiPassword: test1234 asserts: - isKind: of: Deployment @@ -18,27 +13,27 @@ tests: path: spec.template.spec.containers[0].env content: name: grpc_client_pluto_address - value: pluto.sh-helm-prod:9090 + value: pluto.sh-helm-test:9090 - contains: path: spec.template.spec.containers[0].env content: name: spring_profiles_active - value: oc, prod + value: oc, test - contains: path: spec.template.spec.containers[0].env content: name: keycloak_realm - value: sh-helm-prod + value: sh-helm-test - contains: path: spec.template.spec.containers[0].env content: name: keycloak_resource - value: sh-helm-prod-goofy + value: sh-helm-test-goofy - contains: path: spec.template.spec.containers[0].env content: name: keycloak_auth-server-url - value: https://sso.ozg-sh.de + value: https://sso.sh.ozg-cloud.de - contains: path: spec.template.spec.containers[0].env content: diff --git a/src/test/helm/deployment_defaults_labels_test.yaml b/src/test/helm/deployment_defaults_labels_test.yaml index 435293b114807acfa54360af3acfa5c071f7e077..d78322ff6c323d2f651f735f42fec7cba034da50 100644 --- a/src/test/helm/deployment_defaults_labels_test.yaml +++ b/src/test/helm/deployment_defaults_labels_test.yaml @@ -8,11 +8,6 @@ templates: - templates/service.yaml tests: - it: check default labels - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - equal: path: metadata.labels.[app.kubernetes.io/instance] 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 ff3abe23ee3e77eabfce97c0c60aac3742eb91d7..41ce1fb010a6509d1d557cfcb7ed9c55901e6509 100644 --- a/src/test/helm/deployment_defaults_spec_containers_health_test.yaml +++ b/src/test/helm/deployment_defaults_spec_containers_health_test.yaml @@ -6,11 +6,6 @@ templates: - templates/deployment.yaml tests: - it: should work - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment 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 9b495037644a61bbbaff0504a8f4516960d48910..2b3dd9e5a9740eef846a594ed37d237a55f60d88 100644 --- a/src/test/helm/deployment_defaults_spec_containers_securityContext_test.yaml +++ b/src/test/helm/deployment_defaults_spec_containers_securityContext_test.yaml @@ -6,11 +6,6 @@ templates: - templates/deployment.yaml tests: - it: should work - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment diff --git a/src/test/helm/deployment_defaults_spec_containers_test.yaml b/src/test/helm/deployment_defaults_spec_containers_test.yaml index 34a37263a8df719d4958933366d26c4076c3b87e..88685ed780cd0d5d63115b6f9bb0b6c2baf25c58 100644 --- a/src/test/helm/deployment_defaults_spec_containers_test.yaml +++ b/src/test/helm/deployment_defaults_spec_containers_test.yaml @@ -6,17 +6,12 @@ templates: - templates/deployment.yaml tests: - it: check for some standard values - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment - equal: path: spec.template.spec.containers[0].image - value: "docker.ozg-sh.de/goofy:latest" + value: "docker.ozg-sh.de/goofy:snapshot-latest" - equal: path: spec.template.spec.containers[0].imagePullPolicy value: Always @@ -44,15 +39,6 @@ tests: - equal: path: spec.template.spec.containers[0].tty value: true - - it: should add the port for metrics when scrapeMetrics is enabled - set: - kop.bundesland: sh - kop.bezeichner: kiel - kop.environment: dev - sso.apiPassword: test1234 - asserts: - - isKind: - of: Deployment - equal: path: spec.template.spec.containers[0].ports[1].containerPort value: 8081 @@ -62,16 +48,3 @@ tests: - equal: path: spec.template.spec.containers[0].ports[1].protocol value: TCP - - it: should not add the port for metrics when scrapeMetrics is disabled - set: - kop.bundesland: sh - kop.bezeichner: kiel - kop.environment: dev - sso.apiPassword: test1234 - asserts: - - isKind: - of: Deployment - - notContains: - path: spec.template.spec.containers[0].ports - content: - name: metrics \ No newline at end of file diff --git a/src/test/helm/deployment_defaults_spec_test.yaml b/src/test/helm/deployment_defaults_spec_test.yaml index a36146dc77fb2889353f2f1685d0fc09a8eb7690..63ba41dc39aa750d4e6e3e2de22ef1ce170a1b4b 100644 --- a/src/test/helm/deployment_defaults_spec_test.yaml +++ b/src/test/helm/deployment_defaults_spec_test.yaml @@ -6,11 +6,6 @@ templates: - templates/deployment.yaml tests: - it: should work - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment @@ -19,7 +14,7 @@ tests: value: 600 - equal: path: spec.replicas - value: 2 + value: 5 - equal: path: spec.revisionHistoryLimit value: 10 diff --git a/src/test/helm/deployment_defaults_sso_test.yaml b/src/test/helm/deployment_defaults_sso_test.yaml index a2f1e9ed10fbad3be0387d0fc2b14153d92ef35e..2c20228ff81cfe74a49be5439e71f63afc826af5 100644 --- a/src/test/helm/deployment_defaults_sso_test.yaml +++ b/src/test/helm/deployment_defaults_sso_test.yaml @@ -1,16 +1,11 @@ suite: test deployment release: name: goofy - namespace: sh-helm-prod + namespace: sh-helm-test templates: - templates/deployment.yaml tests: - it: check default values - set: - sso.apiPassword: SicherheitGehtVor!!1! - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: prod asserts: - isKind: of: Deployment @@ -18,52 +13,26 @@ tests: path: spec.template.spec.containers[0].env content: name: keycloak_realm - value: sh-helm-prod + value: sh-helm-test - contains: path: spec.template.spec.containers[0].env content: name: keycloak_resource - value: sh-helm-prod-goofy + value: sh-helm-test-goofy - contains: path: spec.template.spec.containers[0].env content: name: keycloak_auth-server-url - value: https://sso.ozg-sh.de + value: https://sso.sh.ozg-cloud.de - contains: path: spec.template.spec.containers[0].env content: name: goofy_keycloak_api_password - value: SicherheitGehtVor!!1! - - it: check sso serverUrl for dev environment - set: - kop.bundesland: sh - kop.bezeichner: name - kop.environment: dev - sso.apiPassword: test1234 - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: keycloak_auth-server-url - value: https://sso.dev.ozg-sh.de - - it: check sso serverUrl for test environment - set: - kop.bundesland: sh - kop.bezeichner: name - kop.environment: test - sso.apiPassword: test1234 - asserts: - - contains: - path: spec.template.spec.containers[0].env - content: - name: keycloak_auth-server-url - value: https://sso.test.ozg-sh.de + value: test1234 + - it: check realm with long namespace set: - kop.bundesland: sh - kop.bezeichner: eins-zwei - kop.environment: prod - sso.apiPassword: test1234 + kop.bezeichner: eins-zwei-drei asserts: - isKind: of: Deployment @@ -71,4 +40,4 @@ tests: path: spec.template.spec.containers[0].env content: name: keycloak_realm - value: sh-eins-zwei-prod \ No newline at end of file + value: sh-eins-zwei-drei-test \ No newline at end of file diff --git a/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml b/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml index c670af4be87ba4893fe272920c17736eae057975..102a8ddd4b570e4a828dc1e075a0e4266c103643 100644 --- a/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml +++ b/src/test/helm/deployment_defaults_topologySpreadConstraints_test.yaml @@ -6,11 +6,6 @@ templates: - templates/deployment.yaml tests: - it: check default values - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment diff --git a/src/test/helm/deployment_env_test.yaml b/src/test/helm/deployment_env_test.yaml index 52702ef3a707850e29f1e783f5e98b090e5aa009..d12a6bd409d89f877ace521b17e0e208c7e6948d 100644 --- a/src/test/helm/deployment_env_test.yaml +++ b/src/test/helm/deployment_env_test.yaml @@ -5,10 +5,6 @@ tests: - it: check customList template: deployment.yaml set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 env.customList: - name: my_test_environment_name value: "A test value" @@ -20,11 +16,6 @@ tests: value: "A test value" - it: check customList test value is not set by default template: deployment.yaml - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - notContains: path: spec.template.spec.containers[0].env diff --git a/src/test/helm/deployment_imageTag_test.yaml b/src/test/helm/deployment_imageTag_test.yaml index 166e053201afe61eda3ef188c06309b7781d2619..1a197caba8fd692d1a947cb48e72e431d763fcaf 100644 --- a/src/test/helm/deployment_imageTag_test.yaml +++ b/src/test/helm/deployment_imageTag_test.yaml @@ -5,16 +5,12 @@ release: templates: - templates/deployment.yaml tests: - - it: should set the snapshot latest imageTag + - it: should set the latest imageTag set: - image.tag: snapshot-latest - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 + image.tag: latest asserts: - isKind: of: Deployment - equal: path: spec.template.spec.containers[0].image - value: docker.ozg-sh.de/goofy:snapshot-latest \ No newline at end of file + value: docker.ozg-sh.de/goofy:latest \ No newline at end of file diff --git a/src/test/helm/deployment_pluto_address_test.yaml b/src/test/helm/deployment_pluto_address_test.yaml index 67e8f5d052e8019e8c7d07b8f965bc2bfa4946d6..cc824d88a04b40f1fb58305fa306d3d7b1b7ec12 100644 --- a/src/test/helm/deployment_pluto_address_test.yaml +++ b/src/test/helm/deployment_pluto_address_test.yaml @@ -8,10 +8,6 @@ tests: - it: should set the pluto name set: plutoName: my-test-pluto-name - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - contains: path: spec.template.spec.containers[0].env diff --git a/src/test/helm/deployment_replicas_test.yaml b/src/test/helm/deployment_replicas_test.yaml index 6fe277c36d6939474d9827dc85211c3c44129113..559cfa95ae45aa77841032a453211ed29d1ff733 100644 --- a/src/test/helm/deployment_replicas_test.yaml +++ b/src/test/helm/deployment_replicas_test.yaml @@ -7,14 +7,10 @@ templates: tests: - it: should set the replica count set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 - replicaCount: 5 + replicaCount: 10 asserts: - isKind: of: Deployment - equal: path: spec.replicas - value: 5 \ No newline at end of file + value: 10 \ 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 131ec3d99c1e0e81cdc2cb99ebf4871b9635131d..c47d1fe81a2ced508980b9bf9980b5e860adebd4 100644 --- a/src/test/helm/deployment_resources_test.yaml +++ b/src/test/helm/deployment_resources_test.yaml @@ -6,10 +6,7 @@ templates: tests: - it: test resources for prod environment set: - kop.bundesland: sh - kop.bezeichner: name kop.environment: prod - sso.apiPassword: test1234 asserts: - equal: path: spec.template.spec.containers[0].resources.limits.cpu @@ -25,10 +22,7 @@ tests: value: 250Mi - it: test default resources set: - kop.bundesland: sh - kop.bezeichner: name kop.environment: dev - sso.apiPassword: test1234 asserts: - equal: path: spec.template.spec.containers[0].resources.limits.cpu diff --git a/src/test/helm/deployment_springProfile_test.yaml b/src/test/helm/deployment_springProfile_test.yaml index 55bb7b804a940211217a0829f86db4664e434e7e..191b22d371650773c42cc666778ca18e7fd2b9c5 100644 --- a/src/test/helm/deployment_springProfile_test.yaml +++ b/src/test/helm/deployment_springProfile_test.yaml @@ -7,11 +7,7 @@ templates: tests: - it: should override the spring profiles set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 - env.overrideSpringProfiles: oc,stage,ea + env.overrideSpringProfiles: oc,test,ea asserts: - isKind: of: Deployment @@ -19,13 +15,8 @@ tests: path: spec.template.spec.containers[0].env content: name: spring_profiles_active - value: oc,stage,ea + value: oc,test,ea - it: should generate the spring profiles - set: - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment diff --git a/src/test/helm/deployment_usermanager_address_test.yaml b/src/test/helm/deployment_usermanager_address_test.yaml index 3519d0cf3c2181ddd34f1af92213626e9d79bf8f..729bb09a74df883ce7bd021b203881e88e77476b 100644 --- a/src/test/helm/deployment_usermanager_address_test.yaml +++ b/src/test/helm/deployment_usermanager_address_test.yaml @@ -8,10 +8,6 @@ tests: - it: should set the usermanager url for test environment set: usermanagerName: my-test-usermanager-name - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment @@ -19,19 +15,4 @@ tests: path: spec.template.spec.containers[0].env content: name: kop_user-manager_url - value: https://helm-my-test-usermanager-name.test.ozg-sh.de - - it: should set the usermanager url for prod environment - set: - usermanagerName: my-test-usermanager-name - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: prod - sso.apiPassword: test1234 - asserts: - - isKind: - of: Deployment - - contains: - path: spec.template.spec.containers[0].env - content: - name: kop_user-manager_url - value: https://helm-my-test-usermanager-name.ozg-sh.de + value: https://helm-my-test-usermanager-name.test.sh.ozg-cloud.de diff --git a/src/test/helm/deployment_usermanager_internal_address_test.yaml b/src/test/helm/deployment_usermanager_internal_address_test.yaml index a3ed9a555b5a4246fb6f75b5b16f5e6271e9789c..b6de60e9c788794ad2f4a14bb89d4c51965f5295 100644 --- a/src/test/helm/deployment_usermanager_internal_address_test.yaml +++ b/src/test/helm/deployment_usermanager_internal_address_test.yaml @@ -8,10 +8,6 @@ tests: - it: should set the internal usermanager url set: usermanagerName: my-test-usermanager-name - kop.bundesland: sh - kop.bezeichner: helm - kop.environment: test - sso.apiPassword: test1234 asserts: - isKind: of: Deployment diff --git a/src/test/helm/ingress-nginx-tests.yaml b/src/test/helm/ingress-nginx-tests.yaml new file mode 100644 index 0000000000000000000000000000000000000000..678556036744219a66b9a0b7354c24cf5f171ed5 --- /dev/null +++ b/src/test/helm/ingress-nginx-tests.yaml @@ -0,0 +1,48 @@ +# +# 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 ingress options +release: + name: goofy + namespace: sh-helm-test +templates: + - templates/ingress.yaml +tests: + - it: should create ingress tls/ingressClass + asserts: + - equal: + path: spec.ingressClassName + value: nginx + - equal: + path: spec.tls[0].secretName + value: helm-goofy-tls + + - it: should not create ingress tls/ingressClass + set: + cluster_env: dataport + asserts: + - isNull: + path: spec.ingressClassName + - isNull: + path: spec.tls[0].secretName diff --git a/src/test/unit-values.yaml b/src/test/unit-values.yaml new file mode 100644 index 0000000000000000000000000000000000000000..fb61a1693c95a56ab804b9aaafc3d7e40d3c06cf --- /dev/null +++ b/src/test/unit-values.yaml @@ -0,0 +1,20 @@ +cluster_env: "" + +replicaCount: 5 +plutoName: pluto +usermanagerName: my-test-usermanager-name + +kop: + bundesland: sh + bezeichner: helm + environment: test + +sso: + apiPassword: test1234 + serverUrl: https://sso.sh.ozg-cloud.de + +baseUrl: test.sh.ozg-cloud.de + +image: + path: docker.ozg-sh.de/goofy + tag: snapshot-latest