apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ template "grafana.fullname" . }}-test
  labels:
    app: {{ template "grafana.fullname" . }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    heritage: "{{ .Release.Service }}"
    release: "{{ .Release.Name }}"
data:
  run.sh: |-
    @test "Test Health" {
      url="http://{{ template "grafana.fullname" . }}/api/health"

      code=$(curl -s -o /dev/null -I -w "%{http_code}" $url)
      [ "$code" == "200" ]
    }
