Skip to content

Commit

Permalink
Improve download script and remove -x parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
xinity committed Oct 10, 2024
1 parent 350783e commit 9cda7f8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion charts/grafana/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,14 @@ download_dashboards.sh: |
{{- range $provider, $dashboards := .Values.dashboards }}
{{- range $key, $value := $dashboards }}
{{- if (or (hasKey $value "gnetId") (hasKey $value "url")) }}
curl -skf \
{{- if $value.url }}
echo "downloading: {{ $key }} dashboard"
echo "Source Url: {{ $value.url }}"
{{- else }}
echo "downloading {{ $key }} dashboard"
echo "Source Url: https://grafana.com/api/dashboards/{{ $value.gnetId }}/revisions/{{- if $value.revision -}}{{ $value.revision }}{{- else -}}1{{- end -}}/download"
{{- end }}
curl -skf --show-error \
--connect-timeout 60 \
--max-time 60 \
{{- if not $value.b64content }}
Expand Down
2 changes: 1 addition & 1 deletion charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ initContainers:
{{- end }}
imagePullPolicy: {{ .Values.downloadDashboardsImage.pullPolicy }}
command: ["/bin/sh"]
args: [ "-c", "mkdir -p /var/lib/grafana/dashboards/default && /bin/sh -x /etc/grafana/download_dashboards.sh" ]
args: [ "-c", "mkdir -p /var/lib/grafana/dashboards/default && /bin/sh /etc/grafana/download_dashboards.sh" ]
{{- with .Values.downloadDashboards.resources }}
resources:
{{- toYaml . | nindent 6 }}
Expand Down

0 comments on commit 9cda7f8

Please sign in to comment.