mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
Signed-off-by: Christopher Larivière <lariviere.c@gmail.com> Co-authored-by: Christopher Larivière <lariviere.c@gmail.com>
80 lines
2 KiB
YAML
80 lines
2 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
|
|
tests:
|
|
- it: default should pass
|
|
asserts:
|
|
- hasDocuments:
|
|
count: 2
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: spec.ports[0].protocol
|
|
value: TCP
|
|
|
|
- it: explicit TCP should pass
|
|
set:
|
|
service.main.ports.http.protocol: TCP
|
|
asserts:
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: spec.ports[0].protocol
|
|
value: TCP
|
|
|
|
- it: explicit UDP should pass
|
|
set:
|
|
service.main.ports.http.protocol: UDP
|
|
asserts:
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: spec.ports[0].protocol
|
|
value: UDP
|
|
|
|
- it: explicit HTTP should pass
|
|
set:
|
|
service.main.ports.http.protocol: HTTP
|
|
asserts:
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: spec.ports[0].protocol
|
|
value: TCP
|
|
- documentIndex: *ServiceDocument
|
|
notExists:
|
|
path: metadata.annotations
|
|
|
|
- it: explicit HTTPS should pass
|
|
set:
|
|
service.main.ports.http.protocol: HTTPS
|
|
asserts:
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: spec.ports[0].protocol
|
|
value: TCP
|
|
|
|
- it: explicit appProtocol should pass
|
|
set:
|
|
service.main.ports.http.appProtocol: kubernetes.io/h2c
|
|
asserts:
|
|
- documentIndex: &ServiceDocument 1
|
|
isKind:
|
|
of: Service
|
|
- documentIndex: *ServiceDocument
|
|
equal:
|
|
path: spec.ports[0].appProtocol
|
|
value: kubernetes.io/h2c
|