mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 08:37:03 +02:00
Signed-off-by: solidDoWant <fred.heinecke@yahoo.com> Co-authored-by: Patrick Collins <Patricol@users.noreply.github.com> Co-authored-by: Patrick Collins <patrick.collins@gainbridge.io> Co-authored-by: Lawrence Gil <larrywtf609@gmail.com> Co-authored-by: solidDoWant <fred.heinecke@yahoo.com>
64 lines
1.5 KiB
YAML
64 lines
1.5 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: service ports
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
- it: default should pass
|
|
values:
|
|
- ../_values/service_main_default.yaml
|
|
documentSelector: &ServiceSelector
|
|
path: $[?(@.kind == "Service")].metadata.name
|
|
value: RELEASE-NAME
|
|
asserts:
|
|
- equal:
|
|
path: spec.ports[0]
|
|
value:
|
|
name: http
|
|
port: 8081
|
|
protocol: TCP
|
|
targetPort: 8081
|
|
|
|
- it: custom name should pass
|
|
values:
|
|
- ../_values/service_main_default.yaml
|
|
set:
|
|
service:
|
|
main:
|
|
ports:
|
|
http:
|
|
enabled: false
|
|
server:
|
|
enabled: true
|
|
port: 8080
|
|
documentSelector: *ServiceSelector
|
|
asserts:
|
|
- equal:
|
|
path: spec.ports[0]
|
|
value:
|
|
name: server
|
|
port: 8080
|
|
protocol: TCP
|
|
targetPort: 8080
|
|
|
|
- it: custom target port should pass
|
|
values:
|
|
- ../_values/service_main_default.yaml
|
|
set:
|
|
service:
|
|
main:
|
|
ports:
|
|
http:
|
|
enabled: true
|
|
targetPort: 80
|
|
documentSelector: *ServiceSelector
|
|
asserts:
|
|
- equal:
|
|
path: spec.ports[0]
|
|
value:
|
|
name: http
|
|
port: 8081
|
|
protocol: TCP
|
|
targetPort: 80
|