Skip to content

Commit

Permalink
fix: cater for all three permutations
Browse files Browse the repository at this point in the history
  • Loading branch information
thameezb committed Oct 23, 2023
1 parent fefadd4 commit 193540a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,9 @@ spec:
{{- if not .Values.prometheus.agentMode }}
{{- if .Values.prometheus.prometheusSpec.thanos }}
thanos:
{{- omit .Values.prometheus.prometheusSpec.thanos "objectStorageConfig" | toYaml | indent 4 }}
{{- with (omit .Values.prometheus.prometheusSpec.thanos "objectStorageConfig")}}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret }}
objectStorageConfig:
key: "{{.Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret.key }}"
Expand Down
4 changes: 2 additions & 2 deletions charts/kube-prometheus-stack/templates/prometheus/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.thanosRuler.enabled }}
{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/component: prometheus
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
data:
{{- with .Values.prometheusspec.thanos.objectStorageConfig }}
{{- with .Values.prometheus.prometheusSpec.thanos.objectStorageConfig }}
{{- if and .secret (not .existingSecret) }}
object-storage-configs.yaml: {{ toYaml .secret | b64enc | quote }}
{{- end }}
Expand Down

0 comments on commit 193540a

Please sign in to comment.