rancher-charts/charts/rancher-external-ip-webhook/100.0.1+up1.0.1/tests/service_test.yaml

69 lines
1.7 KiB
YAML
Raw Normal View History

2020-12-09 01:07:44 +00:00
suite: Test Services
templates:
- service.yaml
tests:
- it: should render webhook-server service with default webhookPort if metrics.enabled = false
set:
metrics.enabled: false
asserts:
- equal:
path: spec.ports[0]
value:
name: webhook-server
port: 443
protocol: TCP
targetPort: 9443
- it: should render webhook-server service with custom webhookPort if metrics.enabled = false
set:
metrics.enabled: false
webhookPort: 9000
asserts:
- equal:
path: spec.ports[0]
value:
name: webhook-server
port: 443
protocol: TCP
targetPort: 9000
- it: should render webhook-server and webhook-metrics services with default webhookPort and metrics.port, if metrics.enabled = true
set:
metrics.enabled: true
asserts:
- equal:
path: spec.ports[0]
value:
name: webhook-server
port: 443
protocol: TCP
targetPort: 9443
documentIndex: 0
- equal:
path: spec.ports[0]
value:
name: webhook-metrics
port: 8443
protocol: TCP
targetPort: 8443
documentIndex: 1
- it: should render webhook-server and webhook-metrics services with custom webhookPort and metrics.port, if metrics.enabled = true
set:
metrics.enabled: true
metrics.port: 8000
webhookPort: 9000
asserts:
- equal:
path: spec.ports[0]
value:
name: webhook-server
port: 443
protocol: TCP
targetPort: 9000
documentIndex: 0
- equal:
path: spec.ports[0]
value:
name: webhook-metrics
port: 8443
protocol: TCP
targetPort: 8000
documentIndex: 1