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

OZG_6513 resolve comments

parent 5d252b61
No related branches found
No related tags found
No related merge requests found
...@@ -437,7 +437,7 @@ Void setNewGitopsVersion(String environment) { ...@@ -437,7 +437,7 @@ Void setNewGitopsVersion(String environment) {
envFile = "${environment}/application/values/alfa-client-values.yaml" envFile = "${environment}/application/values/alfa-client-values.yaml"
commitMessage = "jenkins rollout ${environment} alfa-client version ${IMAGE_TAG}"; commitMessage = "jenkins rollout ${environment} alfa-client version ${IMAGE_TAG}";
setNewGitopsVersion(envFile, commitMessage); setNewAlfaClientGitopsVersion(envFile, commitMessage);
} }
Void setNewBarrierefreiheitVersion() { Void setNewBarrierefreiheitVersion() {
...@@ -462,6 +462,22 @@ Void setNewGitopsVersion(String envFile, String commitMessage) { ...@@ -462,6 +462,22 @@ Void setNewGitopsVersion(String envFile, String commitMessage) {
} }
} }
Void setNewAlfaClientGitopsVersion(String envFile, String commitMessage) {
dir("gitops") {
def envVersions = readYaml file: envFile
envVersions.alfa_client.image.tag = IMAGE_TAG
envVersions.alfa_client.helm.version = HELM_CHART_VERSION
writeYaml file: envFile, data: envVersions, overwrite: true
if (hasValuesFileChanged(envFile)) {
sh "git add ${envFile}"
sh "git commit -m '${commitMessage}'"
}
}
}
String getCommitHash() { String getCommitHash() {
return "-${env.GIT_COMMIT.take(7)}"; return "-${env.GIT_COMMIT.take(7)}";
} }
......
...@@ -14,7 +14,7 @@ metadata: ...@@ -14,7 +14,7 @@ metadata:
cert-manager.io/cluster-issuer: letsencrypt-prod cert-manager.io/cluster-issuer: letsencrypt-prod
{{- end }} {{- end }}
spec: spec:
{{- if and (.Values.ingress).className (ne (.Values).cluster_env "dataport") }} {{- if (.Values.ingress).className }}
ingressClassName: {{ .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className }}
{{- end }} {{- end }}
rules: rules:
...@@ -42,6 +42,6 @@ spec: ...@@ -42,6 +42,6 @@ spec:
- {{ include "app.baseDomain" . }} - {{ include "app.baseDomain" . }}
{{- if (.Values.ingress).tlsSecretName }} {{- if (.Values.ingress).tlsSecretName }}
secretName: {{ (.Values.ingress).tlsSecretName }} secretName: {{ (.Values.ingress).tlsSecretName }}
{{- else if ne (.Values).cluster_env "dataport" }} {{- else }}
secretName: {{ .Values.ozgcloud.bezeichner }}-{{ .Release.Name }}-tls secretName: {{ .Values.ozgcloud.bezeichner }}-{{ .Release.Name }}-tls
{{- end }} {{- end }}
\ No newline at end of file
...@@ -28,12 +28,17 @@ release: ...@@ -28,12 +28,17 @@ release:
namespace: sh-helm-test namespace: sh-helm-test
templates: templates:
- templates/deployment.yaml - templates/deployment.yaml
set:
imagePullSecret: test-image-secret
tests: tests:
- it: should use correct imagePull secret - it: should use correct imagePull secret
set:
imagePullSecret: test-image-secret
asserts: asserts:
- equal: - equal:
path: spec.template.spec.imagePullSecrets[0].name path: spec.template.spec.imagePullSecrets[0].name
value: test-image-secret value: test-image-secret
\ No newline at end of file - it: should fail template when image pull secret not set
asserts:
- failedTemplate:
errormessage: imagePullSecret must be set
\ No newline at end of file
...@@ -38,20 +38,33 @@ tests: ...@@ -38,20 +38,33 @@ tests:
asserts: asserts:
- isKind: - isKind:
of: Ingress of: Ingress
- it: should create ingress tls - it: should create default ingress tls
asserts: asserts:
- equal: - equal:
path: spec.tls[0].secretName path: spec.tls[0].secretName
value: helm-alfa-client-tls value: helm-alfa-client-tls
- it: should set ingress tls
set:
ingress:
tlsSecretName: client-tls
asserts:
- equal:
path: spec.tls[0].secretName
value: client-tls
- it: should not create ingress tls/ingressClass - it: should not create ingress tls/ingressClass by default
set:
cluster_env: dataport
asserts: asserts:
- isNull: - isNull:
path: spec.ingressClassName path: spec.ingressClassName
- isNull: - it: should set ingress tls/ingressClass
path: spec.tls[0].secretName set:
ingress:
className: ingress
asserts:
- equal:
path: spec.ingressClassName
value: ingress
- it: should use default letsencrypt-prod cluster-issuer - it: should use default letsencrypt-prod cluster-issuer
asserts: asserts:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment