helm-charts/charts/library/common-test/tests/service/port_protocols_test.yaml
Bernd Schorgers 8b33237e27
feat(common): Release library 3.7.0 (#377)
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>
2025-02-07 20:03:04 +01:00

96 lines
2.5 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
suite: service protocols
templates:
- common.yaml
values:
- ../_values/controllers_main_default_container.yaml
tests:
- it: default should render
values:
- ../_values/service_main_default.yaml
documentSelector: &ServiceSelector
path: $[?(@.kind == "Service")].metadata.name
value: RELEASE-NAME
asserts:
- equal:
path: spec.ports[0].protocol
value: TCP
- it: explicit TCP should render
values:
- ../_values/service_main_default.yaml
set:
service.main.ports.http.protocol: TCP
documentSelector: *ServiceSelector
asserts:
- equal:
path: spec.ports[0].protocol
value: TCP
- it: explicit UDP should render
values:
- ../_values/service_main_default.yaml
set:
service.main.ports.http.protocol: UDP
documentSelector: *ServiceSelector
asserts:
- equal:
path: spec.ports[0].protocol
value: UDP
- it: explicit HTTP should render
values:
- ../_values/service_main_default.yaml
set:
service.main.ports.http.protocol: HTTP
documentSelector: *ServiceSelector
asserts:
- equal:
path: spec.ports[0].protocol
value: TCP
- notExists:
path: metadata.annotations
- it: explicit HTTPS should render
values:
- ../_values/service_main_default.yaml
set:
service.main.ports.http.protocol: HTTPS
documentSelector: *ServiceSelector
asserts:
- equal:
path: spec.ports[0].protocol
value: TCP
- it: explicit appProtocol should render
values:
- ../_values/service_main_default.yaml
set:
service.main.ports.http.appProtocol: kubernetes.io/h2c
documentSelector: *ServiceSelector
asserts:
- equal:
path: spec.ports[0].appProtocol
value: kubernetes.io/h2c
- it: mixed protocols can be configured on the same port number
values:
- ../_values/service_main_default.yaml
set:
service.main.ports.udptest:
port: 8081
protocol: UDP
documentSelector: *ServiceSelector
asserts:
- equal:
path: spec.ports
value:
- name: http
port: 8081
protocol: TCP
targetPort: 8081
- name: udptest
port: 8081
protocol: UDP
targetPort: 8081