ingress-nginx-helm/charts/ingress-nginx/tests/controller-servicemonitor_test.yaml
k8s-infra-cherrypick-robot b401ff3912
Chart: Add tests for PrometheusRule & ServiceMonitor. (#11889)
Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
2024-08-27 11:30:24 +02:00

29 lines
922 B
YAML

suite: Controller > ServiceMonitor
templates:
- controller-servicemonitor.yaml
tests:
- it: should create a ServiceMonitor if `controller.metrics.serviceMonitor.enabled` is true
set:
controller.metrics.enabled: true
controller.metrics.serviceMonitor.enabled: true
asserts:
- hasDocuments:
count: 1
- isKind:
of: ServiceMonitor
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
- it: should create a ServiceMonitor with annotations if `controller.metrics.serviceMonitor.annotations` is set
set:
controller.metrics.enabled: true
controller.metrics.serviceMonitor.enabled: true
controller.metrics.serviceMonitor.annotations:
my-little-annotation: test-value
asserts:
- equal:
path: metadata.annotations
value:
my-little-annotation: test-value