Commit df22c6ab authored by Sandro Mathys's avatar Sandro Mathys
Browse files

make helm tests configurable

parent 832edac4
......@@ -42,3 +42,15 @@ frontend:
accessRules: |
Require shib-attr homeOrganization switch.ch
tests:
enabled: true
imagePullSecrets:
# personal(!) access token with read AND write privileges to the registry in order to use the dependency proxy
- name: shibboleth-sp-dependency-proxy
image:
repository: "gitlab.switch.ch/helm-charts/shibboleth-sp/dependency_proxy/containers/curlimages/curl"
tag: "latest"
pullPolicy: "Always"
......@@ -148,6 +148,13 @@ Create the names of the images and pull policies to use
{{- .Values.backend.shibboleth.sessionCache.sealerKeys.image.pullPolicy | default (include "shibboleth-sp.backend.imagePullPolicy" .) }}
{{- end }}
{{- define "shibboleth-sp.tests.image" -}}
{{- printf "%s:%s" .Values.tests.image.repository .Values.tests.image.tag }}
{{- end }}
{{- define "shibboleth-sp.tests.imagePullPolicy" -}}
{{- .Values.tests.image.pullPolicy }}
{{- end }}
{{/*
Create the names of the secrets to use
*/}}
......
{{- if .Values.tests.enabled }}
---
apiVersion: v1
kind: Pod
metadata:
name: {{ include "shibboleth-sp.name" . }}-helm-test-curl
name: {{ include "shibboleth-sp.fullname" . }}-helm-test-curl
annotations:
"helm.sh/hook": test
spec:
{{- if .Values.tests.imagePullSecrets }}
imagePullSecrets:
# personal(!) access token with read AND write privileges to the registry in order to use the dependency proxy
- name: shibboleth-sp-dependency-proxy
{{- with .Values.tests.imagePullSecrets }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
# check apache is responding
- name: root
image: "gitlab.switch.ch/helm-charts/shibboleth-sp/dependency_proxy/containers/curlimages/curl:7.75.0"
image: "{{ include "shibboleth-sp.tests.image" . }}"
imagePullPolicy: "{{ include "shibboleth-sp.tests.imagePullPolicy" . }}"
command:
- "sh"
- "-c"
......@@ -27,7 +32,8 @@ spec:
grep "Location: https://wayf.switch.ch/SWITCHaai/WAYF" /tmp/header.out
# check shibboleth is responding
- name: session
image: "gitlab.switch.ch/helm-charts/shibboleth-sp/dependency_proxy/containers/curlimages/curl:7.75.0"
image: "{{ include "shibboleth-sp.tests.image" . }}"
imagePullPolicy: "{{ include "shibboleth-sp.tests.imagePullPolicy" . }}"
command:
- "sh"
- "-c"
......@@ -41,3 +47,4 @@ spec:
grep "200 OK" /tmp/header.out
grep "A valid session was not found." /tmp/document.out
restartPolicy: Never
{{- end -}}
......@@ -321,3 +321,16 @@ frontend:
proxyPreserveHost: "" # default: "off"
remoteURL: "" # must be absolute (i.e. starting with http:// or https://)
accessRules: ""
# helm tests
tests:
enabled: false
# imagePullSecrets:
# - name:
# requires sh, echo, cat, curl, grep in the path of the image
image:
repository: "docker.io/curlimages/curl"
tag: "latest"
pullPolicy: "IfNotPresent"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment