---
apiVersion: v1
kind: Pod
metadata:
  name: {{ include "vpa.fullname" . }}-test-metrics-api-available
  labels:
    {{- include "vpa.labels" . | nindent 4 }}
  annotations:
    "helm.sh/hook": test
    "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
    "helm.sh/hook-weight": "40"
spec:
  serviceAccountName: {{ include "vpa.fullname" . }}-test
  containers:
    - name: test
      {{- if .Values.tests.securityContext }}
      securityContext:
      {{- toYaml .Values.tests.securityContext | nindent 8 }}
      {{- end }}
      image: {{ include "vpa.test.image" . }}
      {{- if .Values.tests.image }}
      imagePullPolicy: {{ .Values.tests.image.pullPolicy }}
      {{- end }}
      command: ['kubectl']
      args:
        - get
        - --raw
        - "/apis/metrics.k8s.io/v1beta1/nodes"
  restartPolicy: Never
