Skip to content

Commit

Permalink
kommander: Add missing script line, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gracedo committed Jan 28, 2020
1 parent 4276e1a commit 4c32f8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions stable/kommander/templates/grafana/hooks-home-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{ include "kommander.labels" . | indent 4 }}
annotations:
helm.sh/hook: post-install
helm.sh/hook-weight: "-4"
helm.sh/hook-weight: "-5"
helm.sh/hook-delete-policy: hook-succeeded,before-hook-creation
spec:
template:
Expand All @@ -35,7 +35,6 @@ spec:
configMap:
name: {{ .Values.grafana.hooks.jobName }}
defaultMode: 0777

---
apiVersion: v1
kind: ConfigMap
Expand All @@ -48,8 +47,9 @@ data:
set -o errexit
set -o pipefail
CURL="curl --verbose --fail --max-time 60 --retry 10 --retry-connrefused"
DASHBOARD_ID=$($CURL -H "X-Forwarded-User: $X_FORWARDED_USER" {{ .Values.grafana.hooks.serviceURL }}/api/dashboards/uid/{{ .Values.grafana.hooks.homeDashboardUID }} | jq '.[0].id')
DASHBOARD_ID=$($CURL -H "X-Forwarded-User: $X_FORWARDED_USER" {{ .Values.grafana.hooks.serviceURL }}/api/dashboards/uid/{{ .Values.grafana.hooks.homeDashboardUID }} | jq '.dashboard.id')
echo "setting home dashboard to ID" $DASHBOARD_ID
$CURL -X PUT -H "Content-Type: application/json" -H "X-Forwarded-User: $X_FORWARDED_USER" -d '{"homeDashboardId":'"$DASHBOARD_ID"'}' {{ .Values.grafana.hooks.serviceURL }}/api/org/preferences
---
apiVersion: batch/v1
kind: Job
Expand All @@ -60,7 +60,7 @@ metadata:
{{ include "kommander.labels" . | indent 4 }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-weight": "-4"
"helm.sh/hook-weight": "-5"
"helm.sh/hook-delete-policy": hook-succeeded
spec:
template:
Expand Down
2 changes: 1 addition & 1 deletion stable/kommander/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ grafana:
jobName: grafana-home-dashboard
image: dwdraju/alpine-curl-jq
secretKeyRef: ops-portal-credentials
serviceURL: http://kommander-kubeaddons-grafana.kommander:3000
serviceURL: http://kommander-kubeaddons-grafana.kommander
homeDashboardUID: efa86fd1d0c121a26444b636a3f509a8

## Do not deploy default dashboards.
Expand Down

0 comments on commit 4c32f8f

Please sign in to comment.