prometheus-postgres-exporter/unittests/ingress/ingress.yaml

141 lines
3.4 KiB
YAML
Raw Normal View History

2024-11-25 10:53:09 +00:00
chart:
appVersion: 0.1.0
version: 0.1.0
suite: Ingress template (basic)
release:
name: prometheus-postgres-exporter-unittest
namespace: testing
templates:
- templates/prometheus-postgres-exporter/ingress.yaml
tests:
- it: Skip ingress by default.
asserts:
- hasDocuments:
count: 0
- it: Skip ingress, when service is disabled.
set:
services.http.enabled: false
ingress.enabled: true
asserts:
- hasDocuments:
count: 0
- it: Render ingress with default values.
set:
ingress.enabled: true
ingress.hosts:
- host: postgres-exporter.example.local
paths:
- path: /
pathType: Prefix
ingress.tls:
- secretName: postgres-exporter-http-tls
hosts:
- postgres-exporter.example.local
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: networking.k8s.io/v1
kind: Ingress
name: prometheus-postgres-exporter-unittest
namespace: testing
- notExists:
path: metadata.annotations
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: prometheus-postgres-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-postgres-exporter
app.kubernetes.io/version: 0.1.0
helm.sh/chart: prometheus-postgres-exporter-0.1.0
- equal:
path: spec.ingressClassName
value: nginx
- contains:
path: spec.rules
content:
host: postgres-exporter.example.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: prometheus-postgres-exporter-unittest
port:
number: 9187
- contains:
path: spec.tls
content:
hosts:
- postgres-exporter.example.local
secretName: postgres-exporter-http-tls
- it: Render ingress with custom values.
set:
ingress.enabled: true
ingress.annotations:
foo: bar
ingress.className: nginx
ingress.labels:
bar: foo
ingress.hosts:
- host: postgres-exporter.example.local
paths:
- path: /
pathType: Prefix
ingress.tls:
- secretName: postgres-exporter-http-tls
hosts:
- postgres-exporter.example.local
services.http.port: 8080
asserts:
- hasDocuments:
count: 1
- containsDocument:
apiVersion: networking.k8s.io/v1
kind: Ingress
name: prometheus-postgres-exporter-unittest
namespace: testing
- equal:
path: metadata.annotations
value:
foo: bar
- equal:
path: metadata.labels
value:
app.kubernetes.io/instance: prometheus-postgres-exporter-unittest
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: prometheus-postgres-exporter
app.kubernetes.io/version: 0.1.0
helm.sh/chart: prometheus-postgres-exporter-0.1.0
bar: foo
- equal:
path: spec.ingressClassName
value: nginx
- contains:
path: spec.rules
content:
host: postgres-exporter.example.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: prometheus-postgres-exporter-unittest
port:
number: 8080
- contains:
path: spec.tls
content:
hosts:
- postgres-exporter.example.local
secretName: postgres-exporter-http-tls