test-configmap.yaml 626 B

1234567891011121314151617181920
  1. {{- if .Values.testFramework.enabled }}
  2. apiVersion: v1
  3. kind: ConfigMap
  4. metadata:
  5. name: {{ template "grafana.fullname" . }}-test
  6. namespace: {{ template "grafana.namespace" . }}
  7. annotations:
  8. "helm.sh/hook": test-success
  9. "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded"
  10. labels:
  11. {{- include "grafana.labels" . | nindent 4 }}
  12. data:
  13. run.sh: |-
  14. @test "Test Health" {
  15. url="http://{{ template "grafana.fullname" . }}/api/health"
  16. code=$(wget --server-response --spider --timeout 90 --tries 10 ${url} 2>&1 | awk '/^ HTTP/{print $2}')
  17. [ "$code" == "200" ]
  18. }
  19. {{- end }}