feat(common)!: Release v3.0.0-beta2 (#280)

This commit is contained in:
Bernd Schorgers 2024-03-08 08:51:40 +01:00 committed by GitHub
parent 23ae8131da
commit 21e751bc16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
51 changed files with 419 additions and 368 deletions

View file

@ -48,6 +48,13 @@ controllers:
HTTP_PORT: 8889 HTTP_PORT: 8889
HTTPS_PORT: 9999 HTTPS_PORT: 9999
service:
main:
controller: main
ports:
http:
port: 8081
ingress: ingress:
main: main:
hosts: hosts:

View file

@ -0,0 +1,6 @@
service:
main:
controller: main
ports:
http:
port: 8081

View file

@ -12,8 +12,8 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ConfigmapDocument 2 - documentIndex: &ConfigmapDocument 1
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *ConfigmapDocument - documentIndex: *ConfigmapDocument
@ -40,8 +40,8 @@ tests:
test_label: test test_label: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ConfigmapDocument 2 - documentIndex: &ConfigmapDocument 1
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *ConfigmapDocument - documentIndex: *ConfigmapDocument
@ -76,8 +76,8 @@ tests:
test_label: test test_label: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ConfigmapDocument 2 - documentIndex: &ConfigmapDocument 1
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *ConfigmapDocument - documentIndex: *ConfigmapDocument

View file

@ -7,15 +7,11 @@ tests:
- it: default should pass - it: default should pass
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: 1
not: true
isKind:
of: ConfigMap
- it: with disabled configMap should pass - it: with disabled configMap should pass
set: set:
@ -26,15 +22,11 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: 1
not: true
isKind:
of: ConfigMap
- it: with multiple configMap should pass - it: with multiple configMap should pass
set: set:
@ -47,14 +39,14 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: &FirstConfigmapDocument 2 - documentIndex: &FirstConfigmapDocument 1
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *FirstConfigmapDocument - documentIndex: *FirstConfigmapDocument
isNotNullOrEmpty: isNotNullOrEmpty:
path: metadata.name path: metadata.name
- documentIndex: &SecondConfigmapDocument 3 - documentIndex: &SecondConfigmapDocument 2
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *SecondConfigmapDocument - documentIndex: *SecondConfigmapDocument
@ -69,8 +61,8 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ConfigmapDocument 2 - documentIndex: &ConfigmapDocument 1
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *ConfigmapDocument - documentIndex: *ConfigmapDocument
@ -87,8 +79,8 @@ tests:
nameOverride: http nameOverride: http
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ConfigmapDocument 2 - documentIndex: &ConfigmapDocument 1
isKind: isKind:
of: ConfigMap of: ConfigMap
- documentIndex: *ConfigmapDocument - documentIndex: *ConfigmapDocument

View file

@ -14,6 +14,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
enabled: true enabled: true
@ -57,6 +58,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
enabled: true enabled: true
@ -104,6 +106,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
enabled: true enabled: true
@ -148,6 +151,7 @@ tests:
service: service:
main: main:
enabled: false enabled: false
controller: main
asserts: asserts:
- documentIndex: 0 - documentIndex: 0
isKind: isKind:
@ -166,6 +170,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
protocol: HTTP protocol: HTTP
@ -198,6 +203,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -229,6 +235,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -260,6 +267,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -296,6 +304,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -332,6 +341,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -368,6 +378,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -396,6 +407,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -424,6 +436,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80
@ -452,6 +465,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80

View file

@ -29,14 +29,14 @@ tests:
tag: 31 tag: 31
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &firstDeploymentDoc 0 - documentIndex: &firstDeploymentDoc 0
isKind: isKind:
of: Deployment of: Deployment
- documentIndex: *firstDeploymentDoc - documentIndex: *firstDeploymentDoc
equal: equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME value: RELEASE-NAME-main
- documentIndex: *firstDeploymentDoc - documentIndex: *firstDeploymentDoc
equal: equal:
path: metadata.labels['app.kubernetes.io/component'] path: metadata.labels['app.kubernetes.io/component']
@ -65,14 +65,14 @@ tests:
tag: 31 tag: 31
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &firstDeploymentDoc 0 - documentIndex: &firstDeploymentDoc 0
isKind: isKind:
of: Deployment of: Deployment
- documentIndex: *firstDeploymentDoc - documentIndex: *firstDeploymentDoc
equal: equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME value: RELEASE-NAME-main
- documentIndex: *firstDeploymentDoc - documentIndex: *firstDeploymentDoc
equal: equal:
path: metadata.labels['app.kubernetes.io/component'] path: metadata.labels['app.kubernetes.io/component']
@ -131,16 +131,4 @@ tests:
controllers.main.enabled: false controllers.main.enabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 1 count: 0
- documentIndex: &ControllerDoc 0
not: true
isKind:
of: StatefulSet
- documentIndex: *ControllerDoc
not: true
isKind:
of: DaemonSet
- documentIndex: *ControllerDoc
not: true
isKind:
of: Controller

View file

@ -10,7 +10,7 @@ values:
tests: tests:
- it: default metadata should pass - it: default metadata should pass
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -33,7 +33,7 @@ tests:
labels: labels:
test_label: test test_label: test
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -64,7 +64,7 @@ tests:
labels: labels:
test_label: test test_label: test
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument

View file

@ -7,15 +7,11 @@ tests:
- it: default should pass - it: default should pass
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: 1
not: true
isKind:
of: Ingress
- it: explicitly disabled should pass - it: explicitly disabled should pass
values: values:
@ -24,15 +20,11 @@ tests:
ingress.main.enabled: false ingress.main.enabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: 1
not: true
isKind:
of: Ingress
- it: explicitly enabled should pass - it: explicitly enabled should pass
values: values:
@ -41,16 +33,12 @@ tests:
ingress.main.enabled: true ingress.main.enabled: true
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: 1 - documentIndex: 1
not: true
isKind:
of: Ingress
- documentIndex: 2
isKind: isKind:
of: Ingress of: Ingress
@ -68,23 +56,19 @@ tests:
port: http port: http
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: 1 - documentIndex: &FirstIngressDocument 1
not: true
isKind:
of: Ingress
- documentIndex: &FirstIngressDocument 2
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *FirstIngressDocument - documentIndex: *FirstIngressDocument
equal: equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME value: RELEASE-NAME-main
- documentIndex: &SecondIngressDocument 3 - documentIndex: &SecondIngressDocument 2
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *SecondIngressDocument - documentIndex: *SecondIngressDocument
@ -107,16 +91,12 @@ tests:
port: http port: http
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: 1 - documentIndex: &FirstIngressDocument 1
not: true
isKind:
of: Ingress
- documentIndex: &FirstIngressDocument 2
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *FirstIngressDocument - documentIndex: *FirstIngressDocument

View file

@ -9,6 +9,13 @@ values:
tests: tests:
- it: default should pass - it: default should pass
set:
service:
main:
controller: main
ports:
http:
port: &httpPort 8081
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 2
isKind: isKind:
@ -20,7 +27,7 @@ tests:
service: service:
name: RELEASE-NAME name: RELEASE-NAME
port: port:
number: 8080 number: *httpPort
- it: custom service reference should pass - it: custom service reference should pass
set: set:
@ -33,7 +40,7 @@ tests:
name: pathService name: pathService
port: 1234 port: 1234
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -49,6 +56,7 @@ tests:
set: set:
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &httpPort 8081 port: &httpPort 8081

View file

@ -10,7 +10,7 @@ values:
tests: tests:
- it: default should pass - it: default should pass
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -25,7 +25,7 @@ tests:
hosts: hosts:
- hostname - hostname
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -43,7 +43,7 @@ tests:
- hosts: - hosts:
- hostname - hostname
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -61,7 +61,7 @@ tests:
hosts: hosts:
- hostname - hostname
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -80,7 +80,7 @@ tests:
hosts: hosts:
- hostname - hostname
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument

View file

@ -10,7 +10,7 @@ values:
tests: tests:
- it: default should pass - it: default should pass
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -32,7 +32,7 @@ tests:
service: service:
name: main name: main
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -55,7 +55,7 @@ tests:
name: main name: main
port: http port: http
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -73,7 +73,7 @@ tests:
service: service:
name: main name: main
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument
@ -86,7 +86,7 @@ tests:
ingress.main: ingress.main:
defaultBackend: test defaultBackend: test
asserts: asserts:
- documentIndex: &IngressDocument 2 - documentIndex: &IngressDocument 1
isKind: isKind:
of: Ingress of: Ingress
- documentIndex: *IngressDocument - documentIndex: *IngressDocument

View file

@ -15,7 +15,7 @@ templates:
tests: tests:
- it: default metadata should pass - it: default metadata should pass
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument
@ -39,7 +39,7 @@ tests:
labels: labels:
test_label: test test_label: test
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument
@ -71,7 +71,7 @@ tests:
labels: labels:
test_label: test test_label: test
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument

View file

@ -15,8 +15,8 @@ tests:
rules: {} rules: {}
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument
@ -35,7 +35,7 @@ tests:
rules: {} rules: {}
nameOverride: block-ingress nameOverride: block-ingress
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument

View file

@ -8,13 +8,11 @@ tests:
- it: main networkpolicy is disabled by default - it: main networkpolicy is disabled by default
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true
isKind: isKind:
of: Deployment of: NetworkPolicy
- documentIndex: 1
isKind:
of: Service
- it: main networkpolicy can be enabled - it: main networkpolicy can be enabled
set: set:
@ -26,14 +24,11 @@ tests:
rules: {} rules: {}
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: 0 - documentIndex: 0
isKind: isKind:
of: Deployment of: Deployment
- documentIndex: 1 - documentIndex: 1
isKind:
of: Service
- documentIndex: 2
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
@ -47,7 +42,7 @@ tests:
- Egress - Egress
rules: {} rules: {}
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument
@ -70,7 +65,7 @@ tests:
podSelector: {} podSelector: {}
rules: {} rules: {}
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument
@ -92,7 +87,7 @@ tests:
egress: egress:
- {} - {}
asserts: asserts:
- documentIndex: &NetworkPolicyDocument 2 - documentIndex: &NetworkPolicyDocument 1
isKind: isKind:
of: NetworkPolicy of: NetworkPolicy
- documentIndex: *NetworkPolicyDocument - documentIndex: *NetworkPolicyDocument

View file

@ -7,7 +7,7 @@ tests:
- it: default should pass - it: default should pass
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &deploymentDocument 0 - documentIndex: &deploymentDocument 0
isKind: isKind:
of: Deployment of: Deployment
@ -22,7 +22,7 @@ tests:
create: true create: true
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: &serviceAccountDocument 0 - documentIndex: &serviceAccountDocument 0
isKind: isKind:
of: ServiceAccount of: ServiceAccount
@ -41,7 +41,7 @@ tests:
name: mySA name: mySA
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: &serviceAccountDocument 0 - documentIndex: &serviceAccountDocument 0
isKind: isKind:
of: ServiceAccount of: ServiceAccount
@ -60,7 +60,7 @@ tests:
name: mySA name: mySA
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &deploymentDocument 0 - documentIndex: &deploymentDocument 0
isKind: isKind:
of: Deployment of: Deployment

View file

@ -15,22 +15,18 @@ tests:
persistence.config.enabled: false persistence.config.enabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: PersistentVolumeClaim of: PersistentVolumeClaim
- documentIndex: 1
not: true
isKind:
of: PersistentVolumeClaim
- it: enabled should pass - it: enabled should pass
set: set:
persistence.config.enabled: true persistence.config.enabled: true
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &PersistentVolumeClaimDocument 0 - documentIndex: &PersistentVolumeClaimDocument 0
isKind: isKind:
of: PersistentVolumeClaim of: PersistentVolumeClaim
@ -38,10 +34,6 @@ tests:
not: true not: true
isKind: isKind:
of: PersistentVolumeClaim of: PersistentVolumeClaim
- documentIndex: 2
not: true
isKind:
of: PersistentVolumeClaim
- documentIndex: *PersistentVolumeClaimDocument - documentIndex: *PersistentVolumeClaimDocument
equal: equal:
path: metadata.name path: metadata.name

View file

@ -12,7 +12,7 @@ tests:
size: 1Gi size: 1Gi
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &PersistentVolumeClaimDocument 0 - documentIndex: &PersistentVolumeClaimDocument 0
isKind: isKind:
of: PersistentVolumeClaim of: PersistentVolumeClaim
@ -30,7 +30,7 @@ tests:
size: 1Gi size: 1Gi
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &PersistentVolumeClaimDocument 0 - documentIndex: &PersistentVolumeClaimDocument 0
isKind: isKind:
of: PersistentVolumeClaim of: PersistentVolumeClaim
@ -48,7 +48,7 @@ tests:
size: 1Gi size: 1Gi
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &PersistentVolumeClaimDocument 0 - documentIndex: &PersistentVolumeClaimDocument 0
isKind: isKind:
of: Deployment of: Deployment

View file

@ -7,12 +7,11 @@ tests:
- it: default metadata should pass - it: default metadata should pass
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: test - name: test
namespace: test namespace: test
asserts: asserts:
- documentIndex: &routeDocument 2 - documentIndex: &routeDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *routeDocument - documentIndex: *routeDocument
@ -30,7 +29,6 @@ tests:
- it: custom metadata should pass - it: custom metadata should pass
set: set:
route.main: route.main:
enabled: true
annotations: annotations:
test_annotation: test test_annotation: test
labels: labels:
@ -39,7 +37,7 @@ tests:
- name: test - name: test
namespace: test namespace: test
asserts: asserts:
- documentIndex: &routeDocument 2 - documentIndex: &routeDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *routeDocument - documentIndex: *routeDocument
@ -65,7 +63,6 @@ tests:
annotations: annotations:
global_annotation: test global_annotation: test
route.main: route.main:
enabled: true
annotations: annotations:
test_annotation: test test_annotation: test
labels: labels:
@ -74,7 +71,7 @@ tests:
- name: test - name: test
namespace: test namespace: test
asserts: asserts:
- documentIndex: &routeDocument 2 - documentIndex: &routeDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *routeDocument - documentIndex: *routeDocument

View file

@ -7,30 +7,22 @@ tests:
- it: default should pass - it: default should pass
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: 1
not: true
isKind:
of: HTTPRoute
- it: explicitly disabled should pass - it: explicitly disabled should pass
set: set:
route.main.enabled: false route.main.enabled: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: 1
not: true
isKind:
of: HTTPRoute
- it: explicitly enabled should pass - it: explicitly enabled should pass
set: set:
@ -41,16 +33,12 @@ tests:
namespace: test namespace: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: 1 - documentIndex: 1
not: true
isKind:
of: HTTPRoute
- documentIndex: 2
isKind: isKind:
of: HTTPRoute of: HTTPRoute
@ -58,29 +46,23 @@ tests:
set: set:
route: route:
main: main:
enabled: true
parentRefs: parentRefs:
- name: main - name: main
namespace: main namespace: main
test: test:
enabled: true
parentRefs: parentRefs:
- name: test - name: test
namespace: test namespace: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: 1 - documentIndex: 1
not: true
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: 2 - documentIndex: 2
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: 3
isKind:
of: HTTPRoute

View file

@ -7,7 +7,6 @@ tests:
- it: default should pass - it: default should pass
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
@ -20,7 +19,7 @@ tests:
port: 8080 port: 8080
weight: 1 weight: 1
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *HTTPRouteDocument - documentIndex: *HTTPRouteDocument
@ -37,7 +36,6 @@ tests:
- it: custom service reference should pass - it: custom service reference should pass
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
@ -49,7 +47,7 @@ tests:
namespace: serviceNamespace namespace: serviceNamespace
weight: 123 weight: 123
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *HTTPRouteDocument - documentIndex: *HTTPRouteDocument
@ -66,7 +64,6 @@ tests:
- it: custom service reference with filter should fail - it: custom service reference with filter should fail
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
@ -89,7 +86,6 @@ tests:
- it: custom service with filter should pass - it: custom service with filter should pass
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
@ -100,7 +96,7 @@ tests:
scheme: https scheme: https
statusCode: 301 statusCode: 301
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *HTTPRouteDocument - documentIndex: *HTTPRouteDocument

View file

@ -7,12 +7,11 @@ tests:
- it: setting gateway should pass - it: setting gateway should pass
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *HTTPRouteDocument - documentIndex: *HTTPRouteDocument
@ -27,14 +26,13 @@ tests:
- it: custom host and path should pass - it: custom host and path should pass
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
hostnames: hostnames:
- chart-test.local - chart-test.local
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *HTTPRouteDocument - documentIndex: *HTTPRouteDocument
@ -45,14 +43,13 @@ tests:
- it: custom host with template - it: custom host with template
set: set:
route.main: route.main:
enabled: true
parentRefs: parentRefs:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
hostnames: hostnames:
- "{{ .Release.Name }}.local" - "{{ .Release.Name }}.local"
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocument 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: *HTTPRouteDocument - documentIndex: *HTTPRouteDocument
@ -64,7 +61,6 @@ tests:
set: set:
route: route:
main: main:
enabled: true
kind: HTTPRoute kind: HTTPRoute
parentRefs: parentRefs:
- name: parentName - name: parentName
@ -88,7 +84,6 @@ tests:
timeouts: timeouts:
backendRequest: 30s backendRequest: 30s
grpc: grpc:
enabled: true
kind: GRPCRoute kind: GRPCRoute
parentRefs: parentRefs:
- name: parentName - name: parentName
@ -110,7 +105,6 @@ tests:
type: ReplacePrefixMatch type: ReplacePrefixMatch
replacePrefixMatch: "" replacePrefixMatch: ""
tcp: tcp:
enabled: true
kind: TCPRoute kind: TCPRoute
parentRefs: parentRefs:
- name: parentName - name: parentName
@ -132,7 +126,6 @@ tests:
type: ReplacePrefixMatch type: ReplacePrefixMatch
replacePrefixMatch: "" replacePrefixMatch: ""
tls: tls:
enabled: true
kind: TLSRoute kind: TLSRoute
parentRefs: parentRefs:
- name: parentName - name: parentName
@ -154,7 +147,6 @@ tests:
type: ReplacePrefixMatch type: ReplacePrefixMatch
replacePrefixMatch: "" replacePrefixMatch: ""
udp: udp:
enabled: true
kind: UDPRoute kind: UDPRoute
parentRefs: parentRefs:
- name: parentName - name: parentName
@ -176,17 +168,17 @@ tests:
type: ReplacePrefixMatch type: ReplacePrefixMatch
replacePrefixMatch: "" replacePrefixMatch: ""
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &GRPCRouteDocument 1
isKind: isKind:
of: GRPCRoute of: GRPCRoute
- documentIndex: &HTTPRouteDocument 2 - documentIndex: *GRPCRouteDocument
equal: equal:
path: spec.rules[0].matches path: spec.rules[0].matches
value: value:
- path: - path:
type: PathPrefix type: PathPrefix
value: /test value: /test
- documentIndex: &HTTPRouteDocument 2 - documentIndex: *GRPCRouteDocument
equal: equal:
path: spec.rules[0].filters path: spec.rules[0].filters
value: value:
@ -195,17 +187,17 @@ tests:
path: path:
type: ReplacePrefixMatch type: ReplacePrefixMatch
replacePrefixMatch: "" replacePrefixMatch: ""
- documentIndex: &HTTPRouteDocument 3 - documentIndex: &HTTPRouteDocument 2
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: &HTTPRouteDocument 3 - documentIndex: *HTTPRouteDocument
equal: equal:
path: spec.rules[0].matches path: spec.rules[0].matches
value: value:
- path: - path:
type: PathPrefix type: PathPrefix
value: /test value: /test
- documentIndex: &HTTPRouteDocument 3 - documentIndex: *HTTPRouteDocument
equal: equal:
path: spec.rules[0].filters path: spec.rules[0].filters
value: value:
@ -214,34 +206,34 @@ tests:
path: path:
type: ReplacePrefixMatch type: ReplacePrefixMatch
replacePrefixMatch: "" replacePrefixMatch: ""
- documentIndex: &HTTPRouteDocument 4 - documentIndex: &TCPRouteDocument 3
isKind: isKind:
of: TCPRoute of: TCPRoute
- documentIndex: &HTTPRouteDocument 4 - documentIndex: *TCPRouteDocument
notExists: notExists:
path: spec.rules[0].matches path: spec.rules[0].matches
- documentIndex: &HTTPRouteDocument 4 - documentIndex: *TCPRouteDocument
notExists: notExists:
path: spec.rules[0].filters path: spec.rules[0].filters
- documentIndex: &HTTPRouteDocument 5 - documentIndex: &TLSRouteDocument 4
isKind: isKind:
of: TLSRoute of: TLSRoute
- documentIndex: &HTTPRouteDocument 5 - documentIndex: *TLSRouteDocument
notExists: notExists:
path: spec.rules[0].matches path: spec.rules[0].matches
- documentIndex: &HTTPRouteDocument 5 - documentIndex: *TLSRouteDocument
notExists: notExists:
path: spec.rules[0].filters path: spec.rules[0].filters
- documentIndex: &HTTPRouteDocument 6 - documentIndex: &UDPRouteDocument 5
isKind: isKind:
of: UDPRoute of: UDPRoute
- documentIndex: &HTTPRouteDocument 6 - documentIndex: *UDPRouteDocument
notExists: notExists:
path: spec.rules[0].matches path: spec.rules[0].matches
- documentIndex: &HTTPRouteDocument 6 - documentIndex: *UDPRouteDocument
notExists: notExists:
path: spec.rules[0].filters path: spec.rules[0].filters
- documentIndex: &HTTPRouteDocument 6 - documentIndex: *UDPRouteDocument
notExists: notExists:
path: spec.rules[0].timeouts path: spec.rules[0].timeouts
@ -265,16 +257,16 @@ tests:
- name: parentName - name: parentName
namespace: parentNamespace namespace: parentNamespace
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &TCPRouteDocument 1
isKind: isKind:
of: TCPRoute of: TCPRoute
- documentIndex: &HTTPRouteDocument 2 - documentIndex: *TCPRouteDocument
notExists: notExists:
path: spec.hostnames path: spec.hostnames
- documentIndex: &HTTPRouteDocument 3 - documentIndex: &UDPRouteDocument 2
isKind: isKind:
of: UDPRoute of: UDPRoute
- documentIndex: &HTTPRouteDocument 3 - documentIndex: *UDPRouteDocument
notExists: notExists:
path: spec.hostnames path: spec.hostnames
@ -293,16 +285,16 @@ tests:
namespace: parentNamespace namespace: parentNamespace
sectionName: parentSection sectionName: parentSection
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &HTTPRouteDocumentFirst 1
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: &HTTPRouteDocument 2 - documentIndex: *HTTPRouteDocumentFirst
notExists: notExists:
path: spec.parentRefs[0].sectionName path: spec.parentRefs[0].sectionName
- documentIndex: &HTTPRouteDocument 3 - documentIndex: &HTTPRouteDocumentSecond 2
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: &HTTPRouteDocument 3 - documentIndex: *HTTPRouteDocumentSecond
equal: equal:
path: spec.parentRefs[0].sectionName path: spec.parentRefs[0].sectionName
value: parentSection value: parentSection
@ -339,16 +331,16 @@ tests:
timeouts: timeouts:
backendRequest: 10s backendRequest: 10s
asserts: asserts:
- documentIndex: &HTTPRouteDocument 2 - documentIndex: &GRPCRouteDocument 1
isKind: isKind:
of: GRPCRoute of: GRPCRoute
- documentIndex: &HTTPRouteDocument 2 - documentIndex: *GRPCRouteDocument
notExists: notExists:
path: spec.rules[0].timeouts.backendRequest path: spec.rules[0].timeouts.backendRequest
- documentIndex: &HTTPRouteDocument 3 - documentIndex: &HTTPRouteDocument 2
isKind: isKind:
of: HTTPRoute of: HTTPRoute
- documentIndex: &HTTPRouteDocument 3 - documentIndex: *HTTPRouteDocument
equal: equal:
path: spec.rules[0].timeouts.backendRequest path: spec.rules[0].timeouts.backendRequest
value: 30s value: 30s

View file

@ -12,8 +12,8 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &SecretDocument 2 - documentIndex: &SecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecretDocument - documentIndex: *SecretDocument
@ -40,8 +40,8 @@ tests:
test_label: test test_label: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &SecretDocument 2 - documentIndex: &SecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecretDocument - documentIndex: *SecretDocument
@ -76,8 +76,8 @@ tests:
test_label: test test_label: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &SecretDocument 2 - documentIndex: &SecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecretDocument - documentIndex: *SecretDocument
@ -106,8 +106,8 @@ tests:
type: &type kubernetes.io/service-account-token type: &type kubernetes.io/service-account-token
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &SecretDocument 2 - documentIndex: &SecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecretDocument - documentIndex: *SecretDocument

View file

@ -7,15 +7,11 @@ tests:
- it: default should pass - it: default should pass
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Secret of: Secret
- documentIndex: 1
not: true
isKind:
of: Secret
- it: with disabled secret should pass - it: with disabled secret should pass
set: set:
@ -26,15 +22,11 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: 0 - documentIndex: 0
not: true not: true
isKind: isKind:
of: Secret of: Secret
- documentIndex: 1
not: true
isKind:
of: Secret
- it: with multiple secrets should pass - it: with multiple secrets should pass
set: set:
@ -49,14 +41,14 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: &FirstSecretDocument 2 - documentIndex: &FirstSecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *FirstSecretDocument - documentIndex: *FirstSecretDocument
isNotNullOrEmpty: isNotNullOrEmpty:
path: metadata.name path: metadata.name
- documentIndex: &SecondSecretDocument 3 - documentIndex: &SecondSecretDocument 2
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecondSecretDocument - documentIndex: *SecondSecretDocument
@ -71,8 +63,8 @@ tests:
test: test test: test
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &SecretDocument 2 - documentIndex: &SecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecretDocument - documentIndex: *SecretDocument
@ -89,8 +81,8 @@ tests:
nameOverride: http nameOverride: http
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &SecretDocument 2 - documentIndex: &SecretDocument 1
isKind: isKind:
of: Secret of: Secret
- documentIndex: *SecretDocument - documentIndex: *SecretDocument

View file

@ -5,6 +5,8 @@ templates:
- common.yaml - common.yaml
tests: tests:
- it: default metadata should pass - it: default metadata should pass
values:
- ../_values/service_main_default.yaml
asserts: asserts:
- documentIndex: &ServiceDocument 1 - documentIndex: &ServiceDocument 1
isKind: isKind:
@ -23,6 +25,8 @@ tests:
helm.sh/chart: common-test-1.0.0 helm.sh/chart: common-test-1.0.0
- it: custom metadata should pass - it: custom metadata should pass
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -51,6 +55,8 @@ tests:
test_label: test test_label: test
- it: custom metadata with global metadata should pass - it: custom metadata with global metadata should pass
values:
- ../_values/service_main_default.yaml
set: set:
global: global:
labels: labels:

View file

@ -5,6 +5,8 @@ templates:
- common.yaml - common.yaml
tests: tests:
- it: default should pass - it: default should pass
values:
- ../_values/service_main_default.yaml
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 2
@ -17,10 +19,10 @@ tests:
value: RELEASE-NAME value: RELEASE-NAME
- it: custom name suffix should pass - it: custom name suffix should pass
values:
- ../_values/service_main_default.yaml
set: set:
service: service.main.nameOverride: http
main:
nameOverride: http
asserts: asserts:
- documentIndex: &ServiceDocument 1 - documentIndex: &ServiceDocument 1
isKind: isKind:
@ -29,3 +31,31 @@ tests:
equal: equal:
path: metadata.name path: metadata.name
value: RELEASE-NAME-http value: RELEASE-NAME-http
- it: multiple should pass
values:
- ../_values/service_main_default.yaml
set:
service:
second:
controller: main
ports:
ui:
port: 8082
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceDocumentFirst 1
isKind:
of: Service
- documentIndex: *ServiceDocumentFirst
equal:
path: metadata.name
value: RELEASE-NAME-main
- documentIndex: &ServiceDocumentSecond 2
isKind:
of: Service
- documentIndex: *ServiceDocumentSecond
equal:
path: metadata.name
value: RELEASE-NAME-second

View file

@ -5,6 +5,8 @@ templates:
- common.yaml - common.yaml
tests: tests:
- it: default should pass - it: default should pass
values:
- ../_values/service_main_default.yaml
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 2
@ -17,6 +19,8 @@ tests:
value: TCP value: TCP
- it: explicit TCP should pass - it: explicit TCP should pass
values:
- ../_values/service_main_default.yaml
set: set:
service.main.ports.http.protocol: TCP service.main.ports.http.protocol: TCP
asserts: asserts:
@ -29,6 +33,8 @@ tests:
value: TCP value: TCP
- it: explicit UDP should pass - it: explicit UDP should pass
values:
- ../_values/service_main_default.yaml
set: set:
service.main.ports.http.protocol: UDP service.main.ports.http.protocol: UDP
asserts: asserts:
@ -41,6 +47,8 @@ tests:
value: UDP value: UDP
- it: explicit HTTP should pass - it: explicit HTTP should pass
values:
- ../_values/service_main_default.yaml
set: set:
service.main.ports.http.protocol: HTTP service.main.ports.http.protocol: HTTP
asserts: asserts:
@ -56,6 +64,8 @@ tests:
path: metadata.annotations path: metadata.annotations
- it: explicit HTTPS should pass - it: explicit HTTPS should pass
values:
- ../_values/service_main_default.yaml
set: set:
service.main.ports.http.protocol: HTTPS service.main.ports.http.protocol: HTTPS
asserts: asserts:
@ -68,6 +78,8 @@ tests:
value: TCP value: TCP
- it: explicit appProtocol should pass - it: explicit appProtocol should pass
values:
- ../_values/service_main_default.yaml
set: set:
service.main.ports.http.appProtocol: kubernetes.io/h2c service.main.ports.http.appProtocol: kubernetes.io/h2c
asserts: asserts:

View file

@ -5,6 +5,8 @@ templates:
- common.yaml - common.yaml
tests: tests:
- it: default should pass - it: default should pass
values:
- ../_values/service_main_default.yaml
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 2
@ -16,11 +18,13 @@ tests:
path: spec.ports[0] path: spec.ports[0]
value: value:
name: http name: http
port: 8080 port: 8081
protocol: TCP protocol: TCP
targetPort: 8080 targetPort: 8081
- it: custom name should pass - it: custom name should pass
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -44,6 +48,8 @@ tests:
targetPort: 8080 targetPort: 8080
- it: custom target port should pass - it: custom target port should pass
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -60,6 +66,6 @@ tests:
path: spec.ports[0] path: spec.ports[0]
value: value:
name: http name: http
port: 8080 port: 8081
protocol: TCP protocol: TCP
targetPort: 80 targetPort: 80

View file

@ -15,18 +15,17 @@ tests:
port: 80 port: 80
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &FirstServiceDocument 1 - documentIndex: &FirstServiceDocument 1
isKind: isKind:
of: Service of: Service
- documentIndex: &SecondServiceDocument 2
isKind:
of: Service
- documentIndex: *FirstServiceDocument - documentIndex: *FirstServiceDocument
notExists: notExists:
path: spec.allocateLoadBalancerNodePorts path: spec.allocateLoadBalancerNodePorts
- it: services can be disabled - it: services can be disabled
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -39,6 +38,8 @@ tests:
of: Deployment of: Deployment
- it: externalTrafficPolicy should pass for NodePort service - it: externalTrafficPolicy should pass for NodePort service
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -54,6 +55,8 @@ tests:
value: Local value: Local
- it: externalTrafficPolicy should pass for LoadBalancer service - it: externalTrafficPolicy should pass for LoadBalancer service
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -69,6 +72,8 @@ tests:
value: Local value: Local
- it: allocateLoadBalancerNodePorts can be set to true - it: allocateLoadBalancerNodePorts can be set to true
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:
@ -84,6 +89,8 @@ tests:
value: true value: true
- it: allocateLoadBalancerNodePorts can be set to false - it: allocateLoadBalancerNodePorts can be set to false
values:
- ../_values/service_main_default.yaml
set: set:
service: service:
main: main:

View file

@ -7,13 +7,11 @@ tests:
- it: a serviceAccount is not created by default - it: a serviceAccount is not created by default
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &DeploymentDocument 0 - documentIndex: 0
not: true
isKind: isKind:
of: Deployment of: ServiceAccount
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceAccount is not created when disabled - it: a serviceAccount is not created when disabled
set: set:
@ -21,13 +19,11 @@ tests:
create: false create: false
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &DeploymentDocument 0 - documentIndex: 0
not: true
isKind: isKind:
of: Deployment of: ServiceAccount
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceAccount and Secret are created when enabled - it: a serviceAccount and Secret are created when enabled
set: set:
@ -35,17 +31,14 @@ tests:
create: true create: true
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: &ServiceAccountDocument 0 - documentIndex: &ServiceAccountDocument 0
isKind: isKind:
of: ServiceAccount of: ServiceAccount
- documentIndex: &DeploymentDocument 1 - documentIndex: &DeploymentDocument 1
isKind: isKind:
of: Deployment of: Deployment
- documentIndex: &ServiceDocument 2 - documentIndex: &SecretDocument 2
isKind:
of: Service
- documentIndex: &SecretDocument 3
isKind: isKind:
of: Secret of: Secret
- documentIndex: *ServiceAccountDocument - documentIndex: *ServiceAccountDocument
@ -74,17 +67,14 @@ tests:
name: &ServiceAccountName myAccount name: &ServiceAccountName myAccount
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 4 count: 3
- documentIndex: &ServiceAccountDocument 0 - documentIndex: &ServiceAccountDocument 0
isKind: isKind:
of: ServiceAccount of: ServiceAccount
- documentIndex: &DeploymentDocument 1 - documentIndex: &DeploymentDocument 1
isKind: isKind:
of: Deployment of: Deployment
- documentIndex: &ServiceDocument 2 - documentIndex: &SecretDocument 2
isKind:
of: Service
- documentIndex: &SecretDocument 3
isKind: isKind:
of: Secret of: Secret
- documentIndex: *ServiceAccountDocument - documentIndex: *ServiceAccountDocument

View file

@ -8,13 +8,11 @@ tests:
- it: a serviceMonitor is not created by default - it: a serviceMonitor is not created by default
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &ServiceDocument 0 - documentIndex: 0
not: true
isKind: isKind:
of: Deployment of: ServiceMonitor
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceMonitor is not created when disabled - it: a serviceMonitor is not created when disabled
set: set:
@ -24,13 +22,11 @@ tests:
serviceName: "{{ .Release.Name }}" serviceName: "{{ .Release.Name }}"
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 2 count: 1
- documentIndex: &ServiceDocument 0 - documentIndex: 0
not: true
isKind: isKind:
of: Deployment of: ServiceMonitor
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceMonitor is created - it: a serviceMonitor is created
set: set:
@ -47,8 +43,8 @@ tests:
scrapeTimeout: 10s scrapeTimeout: 10s
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ServiceMonitorDocument 2 - documentIndex: &ServiceMonitorDocument 1
isKind: isKind:
of: ServiceMonitor of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument - documentIndex: *ServiceMonitorDocument
@ -95,8 +91,8 @@ tests:
scrapeTimeout: 10s scrapeTimeout: 10s
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ServiceMonitorDocument 2 - documentIndex: &ServiceMonitorDocument 1
isKind: isKind:
of: ServiceMonitor of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument - documentIndex: *ServiceMonitorDocument
@ -124,8 +120,8 @@ tests:
scrapeTimeout: 10s scrapeTimeout: 10s
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ServiceMonitorDocument 2 - documentIndex: &ServiceMonitorDocument 1
isKind: isKind:
of: ServiceMonitor of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument - documentIndex: *ServiceMonitorDocument
@ -155,8 +151,8 @@ tests:
scrapeTimeout: 10s scrapeTimeout: 10s
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ServiceMonitorDocument 2 - documentIndex: &ServiceMonitorDocument 1
isKind: isKind:
of: ServiceMonitor of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument - documentIndex: *ServiceMonitorDocument
@ -187,8 +183,8 @@ tests:
- testlabel2 - testlabel2
asserts: asserts:
- hasDocuments: - hasDocuments:
count: 3 count: 2
- documentIndex: &ServiceMonitorDocument 2 - documentIndex: &ServiceMonitorDocument 1
isKind: isKind:
of: ServiceMonitor of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument - documentIndex: *ServiceMonitorDocument

View file

@ -7,10 +7,3 @@ controllers:
repository: ghcr.io/mendhak/http-https-echo repository: ghcr.io/mendhak/http-https-echo
tag: 31 tag: 31
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
service:
main:
controller: main
ports:
http:
port: 8080

View file

@ -3,7 +3,7 @@ apiVersion: v2
name: common name: common
description: Function library for Helm charts description: Function library for Helm charts
type: library type: library
version: 3.0.0-beta1 version: 3.0.0-beta2
kubeVersion: ">=1.22.0-0" kubeVersion: ">=1.22.0-0"
keywords: keywords:
- common - common

View file

@ -353,40 +353,7 @@
"type": ["number", "string"] "type": ["number", "string"]
}, },
"spec": { "spec": {
"allOf": [ "$ref": "k8s-api.json#/core.v1.Probe"
{
"if": {},
"then": {"$ref": "k8s-api.json#/core.v1.Probe"},
"else": {
"type": "object",
"additionalProperties": false,
"properties": {
"failureThreshold": {
"type": "integer",
"default": 3
},
"initialDelaySeconds": {
"type": "integer",
"default": 0
},
"periodSeconds": {
"type": "integer",
"default": 10
},
"timeoutSeconds": {
"type": "integer",
"default": 1
}
},
"required": [
"initialDelaySeconds",
"periodSeconds",
"timeoutSeconds",
"failureThreshold"
]
}
}
]
}, },
"type": { "type": {
"type": "string", "type": "string",

View file

@ -12,10 +12,8 @@ Convert configMap values to an object
{{- if $objectValues.nameOverride -}} {{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- if ne $identifier "main" -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}}
{{- $_ := set $objectValues "name" $objectName -}} {{- $_ := set $objectValues "name" $objectName -}}
{{- $_ := set $objectValues "identifier" $identifier -}} {{- $_ := set $objectValues "identifier" $identifier -}}

View file

@ -0,0 +1,23 @@
{{/*
Return the enabled controllers.
*/}}
{{- define "bjw-s.common.lib.controller.enabledControllers" -}}
{{- $rootContext := .rootContext -}}
{{- $enabledControllers := dict -}}
{{- range $name, $controller := $rootContext.Values.controllers -}}
{{- if kindIs "map" $controller -}}
{{- /* Enable by default, but allow override */ -}}
{{- $controllerEnabled := true -}}
{{- if hasKey $controller "enabled" -}}
{{- $controllerEnabled = $controller.enabled -}}
{{- end -}}
{{- if $controllerEnabled -}}
{{- $_ := set $enabledControllers $name . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $enabledControllers | toYaml -}}
{{- end -}}

View file

@ -17,7 +17,8 @@ Convert controller values to an object
{{- if $objectValues.nameOverride -}} {{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- if ne $identifier "main" -}} {{- $enabledControllers := (include "bjw-s.common.lib.controller.enabledControllers" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if gt (len $enabledControllers) 1 -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -0,0 +1,23 @@
{{/*
Return the enabled Ingresses.
*/}}
{{- define "bjw-s.common.lib.ingress.enabledIngresses" -}}
{{- $rootContext := .rootContext -}}
{{- $enabledIngress := dict -}}
{{- range $name, $ingress := $rootContext.Values.ingress -}}
{{- if kindIs "map" $ingress -}}
{{- /* Enable by default, but allow override */ -}}
{{- $ingressEnabled := true -}}
{{- if hasKey $ingress "enabled" -}}
{{- $ingressEnabled = $ingress.enabled -}}
{{- end -}}
{{- if $ingressEnabled -}}
{{- $_ := set $enabledIngress $name . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $enabledIngress | toYaml -}}
{{- end -}}

View file

@ -12,7 +12,8 @@ Convert ingress values to an object
{{- if $objectValues.nameOverride -}} {{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- if ne $identifier "main" -}} {{- $enabledIngresses := (include "bjw-s.common.lib.ingress.enabledIngresses" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if gt (len $enabledIngresses) 1 -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -0,0 +1,23 @@
{{/*
Return the enabled NetworkPolicies.
*/}}
{{- define "bjw-s.common.lib.networkPolicy.enabledNetworkPolicies" -}}
{{- $rootContext := .rootContext -}}
{{- $enabledNetworkPolicies := dict -}}
{{- range $name, $networkPolicy := $rootContext.Values.networkPolicy -}}
{{- if kindIs "map" $networkPolicy -}}
{{- /* Enable by default, but allow override */ -}}
{{- $networkPolicyEnabled := true -}}
{{- if hasKey $networkPolicy "enabled" -}}
{{- $networkPolicyEnabled = $networkPolicy.enabled -}}
{{- end -}}
{{- if $networkPolicyEnabled -}}
{{- $_ := set $enabledNetworkPolicies $name . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $enabledNetworkPolicies | toYaml -}}
{{- end -}}

View file

@ -12,7 +12,8 @@ Convert networkPolicy values to an object
{{- if $objectValues.nameOverride -}} {{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- if ne $identifier "main" -}} {{- $enabledNetworkPolicies := (include "bjw-s.common.lib.networkPolicy.enabledNetworkPolicies" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if gt (len $enabledNetworkPolicies) 1 -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -12,10 +12,8 @@ Convert Secret values to an object
{{- if $objectValues.nameOverride -}} {{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- if ne $identifier "main" -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}}
{{- $_ := set $objectValues "name" $objectName -}} {{- $_ := set $objectValues "name" $objectName -}}
{{- $_ := set $objectValues "identifier" $identifier -}} {{- $_ := set $objectValues "identifier" $identifier -}}

View file

@ -13,7 +13,7 @@ Convert Service values to an object
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) }} {{- $enabledServices := (include "bjw-s.common.lib.service.enabledServices" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if and (not $objectValues.primary) (gt 1 (len $enabledServices)) -}} {{- if and (not $objectValues.primary) (gt (len $enabledServices) 1) -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -0,0 +1,23 @@
{{/*
Return the enabled ServiceMonitors.
*/}}
{{- define "bjw-s.common.lib.serviceMonitor.enabledServiceMonitors" -}}
{{- $rootContext := .rootContext -}}
{{- $enabledServiceMonitors := dict -}}
{{- range $name, $serviceMonitor := $rootContext.Values.serviceMonitor -}}
{{- if kindIs "map" $serviceMonitor -}}
{{- /* Enable by default, but allow override */ -}}
{{- $serviceMonitorEnabled := true -}}
{{- if hasKey $serviceMonitor "enabled" -}}
{{- $serviceMonitorEnabled = $serviceMonitor.enabled -}}
{{- end -}}
{{- if $serviceMonitorEnabled -}}
{{- $_ := set $enabledServiceMonitors $name . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $enabledServiceMonitors | toYaml -}}
{{- end -}}

View file

@ -12,7 +12,8 @@ Convert ServiceMonitor values to an object
{{- if $objectValues.nameOverride -}} {{- if $objectValues.nameOverride -}}
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}} {{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
{{- else -}} {{- else -}}
{{- if ne $identifier "main" -}} {{- $enabledServiceMonitors := (include "bjw-s.common.lib.serviceMonitor.enabledServiceMonitors" (dict "rootContext" $rootContext) | fromYaml ) }}
{{- if gt (len $enabledServiceMonitors) 1 -}}
{{- $objectName = printf "%s-%s" $objectName $identifier -}} {{- $objectName = printf "%s-%s" $objectName $identifier -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -1,6 +1,6 @@
{ {
"$schema": "http://json-schema.org/draft-07/schema", "$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.0.0-beta1/charts/library/common/values.schema.json", "$id": "https://raw.githubusercontent.com/bjw-s/helm-charts/common-3.0.0-beta2/charts/library/common/values.schema.json",
"type": "object", "type": "object",
"properties": { "properties": {

View file

@ -35,7 +35,13 @@ examples/helm/vaultwarden/values.yaml
!!! warning !!! warning
These docs are still being written These docs are still being written. Stuff to include:
- Removal of `main` objects
- Object names
- Required fields, json-schema
- Disabled `enableServiceLinks`
- Example migration code
### From 1.x.x to 2.0.x ### From 1.x.x to 2.0.x

View file

@ -43,6 +43,7 @@ spec:
# -- Configures service settings for the chart. # -- Configures service settings for the chart.
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: &port 80 port: &port 80

View file

@ -47,6 +47,7 @@ controllers:
service: service:
# Configure a service for the main application # Configure a service for the main application
main: main:
controller: main
type: ClusterIP type: ClusterIP
ports: ports:
http: http:

View file

@ -65,6 +65,7 @@ controllers:
service: service:
# Configure a service for the main application # Configure a service for the main application
main: main:
controller: main
type: ClusterIP type: ClusterIP
ports: ports:
http: http:

View file

@ -22,6 +22,7 @@ controllers:
# -- Configures service settings for the chart. # -- Configures service settings for the chart.
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: 80 port: 80

View file

@ -22,6 +22,7 @@ controllers:
# -- Configures service settings for the chart. # -- Configures service settings for the chart.
service: service:
main: main:
controller: main
ports: ports:
http: http:
port: 80 port: 80