mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
---
|
|
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
|
suite: route - fields - parentRefs
|
|
templates:
|
|
- common.yaml
|
|
values:
|
|
- ../_values/controllers_main_default_container.yaml
|
|
tests:
|
|
- it: setting gateway should pass
|
|
set:
|
|
route.main:
|
|
parentRefs:
|
|
- name: parentName
|
|
namespace: parentNamespace
|
|
documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.parentRefs[0].name
|
|
value: parentName
|
|
- equal:
|
|
path: spec.parentRefs[0].namespace
|
|
value: parentNamespace
|
|
|
|
- it: sectionName should be optional
|
|
set:
|
|
route:
|
|
main:
|
|
parentRefs:
|
|
- name: parentName
|
|
namespace: parentNamespace
|
|
second:
|
|
parentRefs:
|
|
- name: parentName
|
|
namespace: parentNamespace
|
|
sectionName: parentSection
|
|
asserts:
|
|
- documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: release-name-main
|
|
notExists:
|
|
path: spec.parentRefs[0].sectionName
|
|
- documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: release-name-second
|
|
equal:
|
|
path: spec.parentRefs[0].sectionName
|
|
value: parentSection
|
|
|
|
- it: should be possible to configure port on the parentRefs
|
|
set:
|
|
route.main:
|
|
parentRefs:
|
|
- name: parentName
|
|
namespace: parentNamespace
|
|
port: 443
|
|
documentSelector:
|
|
path: $[?(@.kind == "HTTPRoute")].metadata.name
|
|
value: release-name
|
|
asserts:
|
|
- equal:
|
|
path: spec.parentRefs[0].name
|
|
value: parentName
|
|
- equal:
|
|
path: spec.parentRefs[0].port
|
|
value: 443
|