{{- if .Values.prometheusRule.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
  name: {{ template "goldpinger.fullname" . }}
  {{- if .Values.prometheusRule.namespace }}
  namespace: {{ .Values.prometheusRule.namespace }}
  {{- else }}
  namespace: {{ .Release.Namespace | quote }}
  {{- end }}
  labels:
    {{- include "goldpinger.labels" . | nindent 4 }}
spec:
  {{- with .Values.prometheusRule.rules }}
  groups:
    - name: {{ template "goldpinger.name" $ }}
      rules: {{- tpl (toYaml .) $ | nindent 8 }}
  {{- end }}
{{- end }}
