apiVersion: v1
kind: Pod
metadata:
  name: "{{ template "kyverno.fullname" . }}-test"
  labels:
    {{- include "kyverno.test-labels" . | nindent 4 }}
  annotations:
    "helm.sh/hook": test
spec:
  restartPolicy: Never
  containers:
    - name: wget
      image: {{ .Values.testImage.repository | default "busybox" }}{{- if .Values.testImage.tag }}:{{ .Values.testImage.tag }}{{- end }}
      imagePullPolicy: {{ default .Values.image.pullPolicy .Values.testImage.pullPolicy }}
      command:
        - /bin/sh
        - -c
        - |
          sleep 20 ; wget -O- -S --no-check-certificate https://{{ template "kyverno.serviceName" . }}:{{ .Values.service.port }}/health/liveness
    - name: wget-metrics
      image: {{ .Values.testImage.repository | default "busybox" }}{{- if .Values.testImage.tag }}:{{ .Values.testImage.tag }}{{- end }}
      imagePullPolicy: {{ default .Values.image.pullPolicy .Values.testImage.pullPolicy }}
      command:
        - /bin/sh
        - -c
        - |
          sleep 20 ; wget -O- -S --no-check-certificate http://{{ template "kyverno.serviceName" . }}-metrics:{{ .Values.metricsService.port }}/metrics
