Skip to content

Commit

Permalink
Merge pull request rook#10027 from travisn/prometheus-formatting
Browse files Browse the repository at this point in the history
helm: Correctly check external cluster for prometheus rules
  • Loading branch information
travisn authored Apr 11, 2022
2 parents 7eaef38 + 257dc61 commit 7ace343
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion deploy/charts/rook-ceph-cluster/templates/prometheusrules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,21 @@ metadata:
spec:
# Import the raw prometheus rules since they have descriptions that should not be processed with the helm templates
{{- $root := . }}
{{- if .Values.cephClusterSpec.external }}
{{- if .Values.cephClusterSpec.external.enable }}
{{- range $path, $bytes := .Files.Glob "prometheus/externalrules.yaml" }}
{{ $root.Files.Get $path }}
{{- end }}
{{- else }}
# The local rules are included in two different else statements because helm does not short-circuit
# the checks to allow the check for external settings in a single if statement.
{{- range $path, $bytes := .Files.Glob "prometheus/localrules.yaml" }}
{{ $root.Files.Get $path }}
{{ $root.Files.Get $path | indent 2 }}
{{- end }}
{{- end }}
{{- else }}
{{- range $path, $bytes := .Files.Glob "prometheus/localrules.yaml" }}
{{ $root.Files.Get $path | indent 2 }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 7ace343

Please sign in to comment.