mirror of
https://github.com/kyverno/policy-reporter.git
synced 2024-12-14 11:57:32 +00:00
Use monitoring.grafana.namespace value for namespace when creating grafanadashboard or configmap resources for grafana (#586)
Signed-off-by: Vidar Anima Normann <1858786+vidarno@users.noreply.github.com>
This commit is contained in:
parent
db77adc85b
commit
83d9be9400
7 changed files with 18 additions and 9 deletions
|
@ -112,6 +112,15 @@ maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
|
|||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Get the namespace name for grafana. */}}
|
||||
{{- define "grafana.namespace" -}}
|
||||
{{- if .Values.monitoring.grafana.namespace -}}
|
||||
{{- .Values.monitoring.grafana.namespace -}}
|
||||
{{- else -}}
|
||||
{{- include "policyreporter.namespace" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Get the namespace name. */}}
|
||||
{{- define "policyreporter.logLevel" -}}
|
||||
{{- if .Values.logging.server -}}
|
||||
|
|
|
@ -15,7 +15,7 @@ apiVersion: v1
|
|||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "monitoring.fullname" . }}-clusterpolicy-details-dashboard
|
||||
namespace: {{ include "policyreporter.namespace" . }}
|
||||
namespace: {{ include "grafana.namespace" . }}
|
||||
annotations:
|
||||
{{ $root.grafana.folder.annotation }}: {{ $root.grafana.folder.name }}
|
||||
{{- with .Values.annotations }}
|
||||
|
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
{{ .Values.monitoring.grafana.dashboards.label }}: {{ .Values.monitoring.grafana.dashboards.value | quote }}
|
||||
{{- include "monitoring.labels" . | nindent 4 }}
|
||||
name: {{ include "monitoring.fullname" . }}-clusterpolicy-details-dashboard
|
||||
namespace: {{ include "policyreporter.namespace" . }}
|
||||
namespace: {{ include "grafana.namespace" . }}
|
||||
spec:
|
||||
allowCrossNamespaceImport: {{ .Values.monitoring.grafana.grafanaDashboard.allowCrossNamespaceImport }}
|
||||
folder: {{ .Values.monitoring.grafana.grafanaDashboard.folder }}
|
||||
|
@ -16,4 +16,4 @@ spec:
|
|||
configMapRef:
|
||||
name: {{ include "monitoring.fullname" . }}-clusterpolicy-details-dashboard
|
||||
key: cluster-policy-reporter-details-dashboard.json
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -15,7 +15,7 @@ apiVersion: v1
|
|||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "monitoring.fullname" . }}-overview-dashboard
|
||||
namespace: {{ include "policyreporter.namespace" . }}
|
||||
namespace: {{ include "grafana.namespace" . }}
|
||||
annotations:
|
||||
{{ $root.grafana.folder.annotation }}: {{ $root.grafana.folder.name }}
|
||||
{{- with .Values.annotations }}
|
||||
|
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
{{ .Values.monitoring.grafana.dashboards.label }}: {{ .Values.monitoring.grafana.dashboards.value | quote }}
|
||||
{{- include "monitoring.labels" . | nindent 4 }}
|
||||
name: {{ include "monitoring.fullname" . }}-overview-dashboard
|
||||
namespace: {{ include "policyreporter.namespace" . }}
|
||||
namespace: {{ include "grafana.namespace" . }}
|
||||
spec:
|
||||
allowCrossNamespaceImport: {{ .Values.monitoring.grafana.grafanaDashboard.allowCrossNamespaceImport }}
|
||||
folder: {{ .Values.monitoring.grafana.grafanaDashboard.folder }}
|
||||
|
@ -16,4 +16,4 @@ spec:
|
|||
configMapRef:
|
||||
name: {{ include "monitoring.fullname" . }}-overview-dashboard
|
||||
key: policy-reporter-dashboard.json
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
|
@ -15,7 +15,7 @@ apiVersion: v1
|
|||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "monitoring.fullname" . }}-policy-details-dashboard
|
||||
namespace: {{ include "policyreporter.namespace" . }}
|
||||
namespace: {{ include "grafana.namespace" . }}
|
||||
annotations:
|
||||
{{ $root.grafana.folder.annotation }}: {{ $root.grafana.folder.name }}
|
||||
{{- with .Values.annotations }}
|
||||
|
|
|
@ -6,7 +6,7 @@ metadata:
|
|||
{{ .Values.monitoring.grafana.dashboards.label }}: {{ .Values.monitoring.grafana.dashboards.value | quote }}
|
||||
{{- include "monitoring.labels" . | nindent 4 }}
|
||||
name: {{ include "monitoring.fullname" . }}-policy-details-dashboard
|
||||
namespace: {{ include "policyreporter.namespace" . }}
|
||||
namespace: {{ include "grafana.namespace" . }}
|
||||
spec:
|
||||
allowCrossNamespaceImport: {{ .Values.monitoring.grafana.grafanaDashboard.allowCrossNamespaceImport }}
|
||||
folder: {{ .Values.monitoring.grafana.grafanaDashboard.folder }}
|
||||
|
@ -16,4 +16,4 @@ spec:
|
|||
configMapRef:
|
||||
name: {{ include "monitoring.fullname" . }}-policy-details-dashboard
|
||||
key: policy-reporter-details-dashboard.json
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
Loading…
Reference in a new issue