blob: 0e7a0595a6a22cb71d3b37b747e83bc5173f3ba0 [file] [log] [blame]
gio4a9d83d2024-04-14 13:14:40 +04001apiVersion: v1
2kind: Pod
3metadata:
4 name: "{{ include "zot.fullname" . }}-test-connection-fails"
5 labels:
6 {{- include "zot.labels" . | nindent 4 }}
7 annotations:
8 "helm.sh/hook": test
9 "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
10spec:
11 containers:
12 - name: wget
13 image: alpine:3.18
14 command:
15 - sh
16 - -c
17 - |
18 scheme="http"
19 {{- if eq $.Values.httpGet.scheme "HTTPS"}}
20 scheme="https"
21 {{- end }}
22 echo "$scheme"
23 {{- if .Values.authHeader }}
24 wget --no-check-certificate -o output $scheme://{{ include "zot.fullname" . }}:{{ .Values.service.port }}/v2/_catalog || (grep Unauthorized output)
25 {{- else }}
26 wget --no-check-certificate $scheme://{{ include "zot.fullname" . }}:{{ .Values.service.port }}/v2/_catalog
27 {{- end }}
28 restartPolicy: Never