mirror of https://git.rancher.io/charts
Check that lookup result is not empty
If monitoring was enabled on a setup without a rancher service, such as a docker install, monitoring would fail to install due to a dereference issue.pull/1768/head
parent
6f04b50d75
commit
4f04899cee
|
@ -1,6 +1,9 @@
|
||||||
{{- $chartLabel := .Values.chartLabel }}
|
{{- $chartLabel := .Values.chartLabel }}
|
||||||
{{- if eq $chartLabel "" }}
|
{{- if eq $chartLabel "" }}
|
||||||
{{- $chartLabel = (index (lookup "apps/v1" "Deployment" "cattle-system" "rancher").metadata.labels "chart") }}
|
{{- $rancherDeployment := (lookup "apps/v1" "Deployment" "cattle-system" "rancher") }}
|
||||||
|
{{- if $rancherDeployment }}
|
||||||
|
{{- $chartLabel = (index $rancherDeployment.metadata.labels "chart") }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if ne $chartLabel "" }}
|
{{- if ne $chartLabel "" }}
|
||||||
apiVersion: monitoring.coreos.com/v1
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
|
Loading…
Reference in New Issue