Skip to content

Commit

Permalink
[kube-prometheus-stack] Avoid nil pointer error with empty thanos con…
Browse files Browse the repository at this point in the history
…fig (prometheus-community#4132)

* fix(kps): Avoid nil pointer error with empty thanos config

Signed-off-by: Grace Do <[email protected]>

* fix(kps): Wrap thanos.objectStorageConfig nullable level in missed if else

Signed-off-by: Grace Do <[email protected]>

* feat(kps): Bump chart version

Signed-off-by: Grace Do <[email protected]>

---------

Signed-off-by: Grace Do <[email protected]>
  • Loading branch information
gracedo authored Jan 12, 2024
1 parent c1f69b1 commit 996078e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 55.8.0
version: 55.8.1
appVersion: v0.70.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ spec:
{{- with (omit .Values.prometheus.prometheusSpec.thanos "objectStorageConfig")}}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret }}
{{- if ((.Values.prometheus.prometheusSpec.thanos.objectStorageConfig).existingSecret) }}
objectStorageConfig:
key: "{{.Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret.key }}"
name: "{{.Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret.name }}"
{{- else if .Values.prometheus.prometheusSpec.thanos.objectStorageConfig.secret}}
{{- else if ((.Values.prometheus.prometheusSpec.thanos.objectStorageConfig).secret) }}
objectStorageConfig:
key: object-storage-configs.yaml
name: {{ template "kube-prometheus-stack.fullname" . }}-prometheus
Expand Down

0 comments on commit 996078e

Please sign in to comment.