prometheus-fail2ban-exporte.../unittests/configMaps/grafanaDashboardPostgresExporter.yaml
2025-01-19 21:18:53 +01:00

80 lines
2.3 KiB
YAML

chart:
appVersion: 0.1.0
version: 0.1.0
suite: ConfigMap template (Grafana Dashboard PostgresExporter)
release:
name: prometheus-fail2ban-exporter-unittest
namespace: testing
templates:
- templates/prometheus-fail2ban-exporter/configMapGrafanaDashboardFail2BanExporter.yaml
tests:
- it: Rendering fail2banExporter
asserts:
- hasDocuments:
count: 0
- it: Rendering
set:
grafana.enabled: true
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: v1
kind: ConfigMap
name: prometheus-fail2ban-exporter-unittest-grafana-dashboard-fail2ban-exporter
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: prometheus-fail2ban-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-fail2ban-exporter
app.kubernetes.io/version: 0.1.0
grafana_dashboard: "1"
helm.sh/chart: prometheus-fail2ban-exporter-0.1.0
- exists:
path: data["fail2banExporter.json"]
- it: Test custom annotations and labels
set:
grafana.enabled: true
grafana.dashboards.fail2banExporter.annotations:
foo: bar
grafana.dashboards.fail2banExporter.labels:
bar: foo
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: prometheus-fail2ban-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-fail2ban-exporter
app.kubernetes.io/version: 0.1.0
grafana_dashboard: "1"
helm.sh/chart: prometheus-fail2ban-exporter-0.1.0
bar: foo
- it: Test custom grafana discovery labels
set:
grafana.enabled: true
grafana.dashboardDiscoveryLabels:
grafana_dashboard: null
my-custom-discovery-label: my-value
asserts:
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: prometheus-fail2ban-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-fail2ban-exporter
app.kubernetes.io/version: 0.1.0
my-custom-discovery-label: my-value
helm.sh/chart: prometheus-fail2ban-exporter-0.1.0