mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release common library 3.7.1 (#383)
Co-authored-by: Aisling McGinn <me@aisling.dev>
This commit is contained in:
parent
c94a28baa3
commit
433f6d132b
146 changed files with 232 additions and 222 deletions
|
@ -0,0 +1,143 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: ingress service reference
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/ingress_main_default_hosts.yaml
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
controller: main
|
||||
ports:
|
||||
http:
|
||||
port: &httpPort 8081
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
service:
|
||||
name: RELEASE-NAME
|
||||
port:
|
||||
number: *httpPort
|
||||
|
||||
- it: custom service reference should pass
|
||||
set:
|
||||
ingress.main:
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: /
|
||||
service:
|
||||
name: pathService
|
||||
port: 1234
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 1
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
service:
|
||||
name: pathService
|
||||
port:
|
||||
number: 1234
|
||||
|
||||
- it: custom service reference with template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: /
|
||||
service:
|
||||
name: "{{ .Release.Name }}"
|
||||
port: 1234
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 1
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
service:
|
||||
name: RELEASE-NAME
|
||||
port:
|
||||
number: 1234
|
||||
|
||||
- it: multiple hosts with port name references should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
controller: main
|
||||
ports:
|
||||
http:
|
||||
port: &httpPort 8081
|
||||
http2:
|
||||
enabled: true
|
||||
port: &http2Port 1880
|
||||
ingress:
|
||||
main:
|
||||
className: "nginx"
|
||||
hosts:
|
||||
- host: http.chart-test.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
service:
|
||||
identifier: main
|
||||
port: http
|
||||
- host: http2.chart-test.local
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
service:
|
||||
identifier: main
|
||||
port: http2
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
# First Ingress host
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: http.chart-test.local
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/"
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend.service.name
|
||||
value: "RELEASE-NAME"
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend.service.port.number
|
||||
value: *httpPort
|
||||
# Second Ingress host
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[1].host
|
||||
value: http2.chart-test.local
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[1].http.paths[0].path
|
||||
value: "/"
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[1].http.paths[0].backend.service.name
|
||||
value: "RELEASE-NAME"
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[1].http.paths[0].backend.service.port.number
|
||||
value: *http2Port
|
Loading…
Add table
Add a link
Reference in a new issue