Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/charts/version-checker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ A Helm chart for version-checker
| additionalLabels | object | `{}` | Additional Labels to apply to Service and Deployment/Pod Objects |
| affinity | object | `{}` | Set affinity |
| dashboards.enabled | bool | `false` | Deploy Grafana Dashboard(s) for version-checker |
| dashboards.annotations | object | `{}` | Additional annotations to add to the Grafana Dashboard resources |
| dashboards.grafana | string | `""` | Grafana instance to associate the Dashboard with when using GrafanaOperator |
| dashboards.labels | object | `{}` | Additional labels to add to the Grafana Dashboard |
| docker.password | string | `nil` | Password to authenticate with docker registry |
Expand Down
16 changes: 14 additions & 2 deletions deploy/charts/version-checker/templates/dashboards.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ metadata:
{{- if .Values.dashboards.labels }}
{{ .Values.dashboards.labels | toYaml | nindent 4}}
{{- end }}
{{- if .Values.dashboards.annotations }}
annotations:
{{- .Values.dashboards.annotations | toYaml | nindent 4}}
{{- end }}
data:
internal.json: |-
{{- .Files.Get "dashboards/internal.json" | nindent 4 }}
Expand All @@ -25,8 +29,12 @@ metadata:
labels:
{{- include "version-checker.labels" . | nindent 4 }}
{{- if .Values.dashboards.labels }}
{{- .Values.dashboards.labels | toYaml }}
{{- .Values.dashboards.labels | toYaml | nindent 4}}
{{- end }}
{{- if .Values.dashboards.annotations }}
annotations:
{{- .Values.dashboards.annotations | toYaml | nindent 4}}
{{- end }}
spec:
instanceSelector:
matchLabels:
Expand All @@ -43,8 +51,12 @@ metadata:
labels:
{{- include "version-checker.labels" . | nindent 4 }}
{{- if .Values.dashboards.labels }}
{{- .Values.dashboards.labels | toYaml }}
{{- .Values.dashboards.labels | toYaml | nindent 4}}
{{- end }}
{{- if .Values.dashboards.annotations }}
annotations:
{{- .Values.dashboards.annotations | toYaml | nindent 4}}
{{- end }}
spec:
instanceSelector:
matchLabels:
Expand Down
13 changes: 12 additions & 1 deletion deploy/charts/version-checker/tests/dashboards_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ tests:
- isNotEmpty:
path: .data["internal.json"]

- it: works w/ custom labels
- it: works w/ custom labels and annotations
set:
dashboards.labels:
grafana: "123"
dashboards.annotations:
grafana_folder: "version-checker"
asserts:
- isKind:
of: ConfigMap
Expand All @@ -33,8 +35,14 @@ tests:
- equal:
path: metadata.labels.grafana
value: "123"
- equal:
path: metadata.annotations.grafana_folder
value: "version-checker"

- it: Works w/ GrafanaDashboard
set:
dashboards.annotations:
grafana_folder: "version-checker"
capabilities:
apiVersions:
- grafana.integreatly.org/v1beta1/GrafanaDashboard
Expand Down Expand Up @@ -62,6 +70,9 @@ tests:
- equal:
path: spec.configMapRef.name
value: version-checker-dashboards
- equal:
path: metadata.annotations.grafana_folder
value: "version-checker"

- documentSelector:
path: metadata.name
Expand Down
2 changes: 2 additions & 0 deletions deploy/charts/version-checker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,8 @@ prometheus:
dashboards:
# -- Deploy Grafana Dashboard(s) for version-checker
enabled: false
# -- Additional annotations to add to the Grafana Dashboard resources
annotations: {}
# -- Additional labels to add to the Grafana Dashboard
labels: {}
# -- Grafana instance to associate the Dashboard with when using GrafanaOperator
Expand Down
Loading