| gio | 4a9d83d | 2024-04-14 13:14:40 +0400 | [diff] [blame^] | 1 | apiVersion: v1 |
| 2 | kind: Pod |
| 3 | metadata: |
| 4 | name: "{{ include "zot.fullname" . }}-test-connection" |
| 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 |
| 10 | spec: |
| 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 --header "Authorization: Basic {{ .Values.authHeader }}" $scheme://{{ include "zot.fullname" . }}:{{ .Values.service.port }}/v2/_catalog |
| 25 | {{- else }} |
| 26 | wget --no-check-certificate $scheme://{{ include "zot.fullname" . }}:{{ .Values.service.port }}/v2/_catalog |
| 27 | {{- end }} |
| 28 | restartPolicy: Never |