apiVersion: v1
kind: Pod
metadata:
  name: {{ template "metrics-server.fullname" . }}-test
  labels:
    app: {{ template "metrics-server.name" . }}
    chart: {{ template "metrics-server.chart" . }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  annotations:
    "helm.sh/hook": test-success
spec:
  containers:
  - name: wget
    image: "{{ .Values.testImage.repository }}:{{ .Values.testImage.tag }}"
    imagePullPolicy: {{ .Values.testImage.pullPolicy }}
    command: ['/bin/sh']
    args:
    - -c
    - 'wget -qO- https://{{ include "metrics-server.fullname" . }}:{{ .Values.service.port }}/version | grep -F {{ .Values.image.tag }}'
{{- if .Values.imagePullSecrets }}
  imagePullSecrets:
  {{- range .Values.imagePullSecrets }}
    - name: {{ . }}
  {{- end }}
{{- end }}
  restartPolicy: Never
