mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release version 2.0.0-beta.1 (#173)
This commit is contained in:
parent
19767d668c
commit
7b6ee00be6
189 changed files with 3110 additions and 3023 deletions
93
charts/library/common-test/tests/route/metadata_test.yaml
Normal file
93
charts/library/common-test/tests/route/metadata_test.yaml
Normal file
|
@ -0,0 +1,93 @@
|
|||
suite: route metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
asserts:
|
||||
- documentIndex: &routeDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *routeDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *routeDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: RELEASE-NAME
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
parentRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
asserts:
|
||||
- documentIndex: &routeDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *routeDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *routeDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: RELEASE-NAME
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
route.main:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
parentRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
asserts:
|
||||
- documentIndex: &routeDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *routeDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *routeDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: RELEASE-NAME
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-1.0.0
|
||||
test_label: test
|
84
charts/library/common-test/tests/route/presence_test.yaml
Normal file
84
charts/library/common-test/tests/route/presence_test.yaml
Normal file
|
@ -0,0 +1,84 @@
|
|||
suite: route presence
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
|
||||
- it: explicitly disabled should pass
|
||||
set:
|
||||
route.main.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
|
||||
- it: explicitly enabled should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
|
||||
- it: multiple enabled should pass
|
||||
set:
|
||||
route:
|
||||
main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: main
|
||||
namespace: main
|
||||
test:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: 3
|
||||
isKind:
|
||||
of: HTTPRoute
|
|
@ -0,0 +1,54 @@
|
|||
suite: ingress service reference
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *HTTPRouteDocument
|
||||
equal:
|
||||
path: spec.rules[0].backendRefs[0]
|
||||
value:
|
||||
group: ""
|
||||
kind: Service
|
||||
name: RELEASE-NAME
|
||||
namespace: NAMESPACE
|
||||
port: 8080
|
||||
weight: 1
|
||||
|
||||
- it: custom service reference should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
rules:
|
||||
- backendRefs:
|
||||
- group: test
|
||||
name: pathService
|
||||
port: 1234
|
||||
namespace: serviceNamespace
|
||||
weight: 123
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *HTTPRouteDocument
|
||||
equal:
|
||||
path: spec.rules[0].backendRefs[0]
|
||||
value:
|
||||
group: test
|
||||
kind: Service
|
||||
name: pathService
|
||||
namespace: serviceNamespace
|
||||
port: 1234
|
||||
weight: 123
|
212
charts/library/common-test/tests/route/values_test.yaml
Normal file
212
charts/library/common-test/tests/route/values_test.yaml
Normal file
|
@ -0,0 +1,212 @@
|
|||
suite: route values
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: setting gateway should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *HTTPRouteDocument
|
||||
equal:
|
||||
path: spec.parentRefs[0].name
|
||||
value: parentName
|
||||
- documentIndex: *HTTPRouteDocument
|
||||
equal:
|
||||
path: spec.parentRefs[0].namespace
|
||||
value: parentNamespace
|
||||
|
||||
- it: custom host and path should pass
|
||||
set:
|
||||
route.main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
hostnames:
|
||||
- chart-test.local
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: *HTTPRouteDocument
|
||||
equal:
|
||||
path: spec.hostnames[0]
|
||||
value: chart-test.local
|
||||
|
||||
- it: path matches should only be used for HTTPRoutes
|
||||
set:
|
||||
route:
|
||||
main:
|
||||
enabled: true
|
||||
kind: HTTPRoute
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
rules:
|
||||
- backendRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
grpc:
|
||||
enabled: true
|
||||
kind: GRPCRoute
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
rules:
|
||||
- backendRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
tcp:
|
||||
enabled: true
|
||||
kind: TCPRoute
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
rules:
|
||||
- backendRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
tls:
|
||||
enabled: true
|
||||
kind: TLSRoute
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
rules:
|
||||
- backendRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
udp:
|
||||
enabled: true
|
||||
kind: UDPRoute
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
rules:
|
||||
- backendRefs:
|
||||
- name: test
|
||||
namespace: test
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: GRPCRoute
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isNull:
|
||||
path: spec.rules[0].matches
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
equal:
|
||||
path: spec.rules[0].matches
|
||||
value:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
- documentIndex: &HTTPRouteDocument 4
|
||||
isKind:
|
||||
of: TCPRoute
|
||||
- documentIndex: &HTTPRouteDocument 4
|
||||
isNull:
|
||||
path: spec.rules[0].matches
|
||||
- documentIndex: &HTTPRouteDocument 5
|
||||
isKind:
|
||||
of: TLSRoute
|
||||
- documentIndex: &HTTPRouteDocument 5
|
||||
isNull:
|
||||
path: spec.rules[0].matches
|
||||
- documentIndex: &HTTPRouteDocument 6
|
||||
isKind:
|
||||
of: UDPRoute
|
||||
- documentIndex: &HTTPRouteDocument 6
|
||||
isNull:
|
||||
path: spec.rules[0].matches
|
||||
|
||||
- it: hostnames shouldn't be used for TCPRoutes and UDPRoutes
|
||||
set:
|
||||
route:
|
||||
main:
|
||||
enabled: true
|
||||
kind: TCPRoute
|
||||
hostnames:
|
||||
- chart-test.local
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
udp:
|
||||
enabled: true
|
||||
kind: UDPRoute
|
||||
hostnames:
|
||||
- chart-test.local
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: TCPRoute
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isNull:
|
||||
path: spec.hostnames
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
isKind:
|
||||
of: UDPRoute
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
isNull:
|
||||
path: spec.hostnames
|
||||
|
||||
- it: sectionName in parentRefs should be optional
|
||||
set:
|
||||
route:
|
||||
main:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
second:
|
||||
enabled: true
|
||||
parentRefs:
|
||||
- name: parentName
|
||||
namespace: parentNamespace
|
||||
sectionName: parentSection
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isNull:
|
||||
path: spec.parentRefs[0].sectionName
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
equal:
|
||||
path: spec.parentRefs[0].sectionName
|
||||
value: parentSection
|
Loading…
Add table
Add a link
Reference in a new issue