mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release v2.3.0 (#228)
Signed-off-by: Christopher Larivière <lariviere.c@gmail.com> Co-authored-by: Christopher Larivière <lariviere.c@gmail.com>
This commit is contained in:
parent
8bfc33eb8a
commit
0eac5ba7d7
23 changed files with 638 additions and 17 deletions
|
@ -117,6 +117,11 @@ tests:
|
|||
set:
|
||||
controllers.main.containers.main.env:
|
||||
DYNAMIC_ENV: "{{ .Release.Name }}-admin"
|
||||
TEMPLATE_ENV:
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-secret"
|
||||
key: "{{ .Release.Name }}-key"
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
|
@ -127,6 +132,15 @@ tests:
|
|||
value:
|
||||
name: DYNAMIC_ENV
|
||||
value: RELEASE-NAME-admin
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[1]
|
||||
value:
|
||||
name: TEMPLATE_ENV
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
key: "RELEASE-NAME-key"
|
||||
name: "RELEASE-NAME-secret"
|
||||
|
||||
- it: Combined KeyValue with Explicit ValueFrom should pass
|
||||
set:
|
||||
|
|
|
@ -15,3 +15,76 @@ tests:
|
|||
- documentIndex: *StatefulSetDoc
|
||||
notExists:
|
||||
path: spec.volumeClaimTemplates
|
||||
|
||||
- it: volumeClaimTemplates should pass
|
||||
set:
|
||||
controllers.main:
|
||||
type: statefulset
|
||||
statefulset:
|
||||
volumeClaimTemplates:
|
||||
- name: "storage"
|
||||
size: "10Gi"
|
||||
accessMode: "ReadWriteOnce"
|
||||
asserts:
|
||||
- documentIndex: &StatefulSetDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0]
|
||||
value:
|
||||
metadata:
|
||||
name: storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
- it: volumeClaimTemplates with dataSource should pass
|
||||
set:
|
||||
controllers.main:
|
||||
type: statefulset
|
||||
statefulset:
|
||||
volumeClaimTemplates:
|
||||
- name: "storage"
|
||||
size: "10Gi"
|
||||
accessMode: "ReadWriteOnce"
|
||||
dataSource:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: MySnapshot
|
||||
asserts:
|
||||
- documentIndex: &StatefulSetDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.dataSource
|
||||
value:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: MySnapshot
|
||||
|
||||
- it: volumeClaimTemplates with templated dataSource name should pass
|
||||
set:
|
||||
controllers.main:
|
||||
type: statefulset
|
||||
statefulset:
|
||||
volumeClaimTemplates:
|
||||
- name: "storage"
|
||||
size: "10Gi"
|
||||
accessMode: "ReadWriteOnce"
|
||||
dataSource:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: "{{ .Release.Name }}-config"
|
||||
asserts:
|
||||
- documentIndex: &StatefulSetDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.dataSource.name
|
||||
value: RELEASE-NAME-config
|
||||
|
|
111
charts/library/common-test/tests/pvc/datasource_test.yaml
Normal file
111
charts/library/common-test/tests/pvc/datasource_test.yaml
Normal file
|
@ -0,0 +1,111 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: pvc datasource
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
persistence.config.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
notExists:
|
||||
path: spec.dataSource
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
notExists:
|
||||
path: spec.dataSourceRef
|
||||
|
||||
- it: with dataSource should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
dataSource:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: MySnapshot
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: spec.dataSource
|
||||
value:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: MySnapshot
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
notExists:
|
||||
path: spec.dataSourceRef
|
||||
|
||||
- it: templated dataSource name should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
dataSource:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: "{{ .Release.Name }}-config"
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: spec.dataSource
|
||||
value:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: RELEASE-NAME-config
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
notExists:
|
||||
path: spec.dataSourceRef
|
||||
|
||||
- it: with dataSourceRef should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
dataSourceRef:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: MySnapshot
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: spec.dataSourceRef
|
||||
value:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: MySnapshot
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
notExists:
|
||||
path: spec.dataSource
|
||||
|
||||
- it: templated dataSourceRef name should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
dataSourceRef:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: "{{ .Release.Name }}-config"
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: spec.dataSourceRef
|
||||
value:
|
||||
apiGroup: snapshot.storage.k8s.io
|
||||
kind: VolumeSnapshot
|
||||
name: RELEASE-NAME-config
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
notExists:
|
||||
path: spec.dataSource
|
|
@ -60,7 +60,7 @@ tests:
|
|||
path: spec.hostnames[0]
|
||||
value: RELEASE-NAME.local
|
||||
|
||||
- it: path matches should only be used for HTTPRoutes
|
||||
- it: path matches should only be used for HTTPRoutes and GRPCRoutes
|
||||
set:
|
||||
route:
|
||||
main:
|
||||
|
@ -77,6 +77,12 @@ tests:
|
|||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
filters:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
grpc:
|
||||
enabled: true
|
||||
kind: GRPCRoute
|
||||
|
@ -91,6 +97,12 @@ tests:
|
|||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
filters:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
tcp:
|
||||
enabled: true
|
||||
kind: TCPRoute
|
||||
|
@ -105,6 +117,12 @@ tests:
|
|||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
filters:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
tls:
|
||||
enabled: true
|
||||
kind: TLSRoute
|
||||
|
@ -119,6 +137,12 @@ tests:
|
|||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
filters:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
udp:
|
||||
enabled: true
|
||||
kind: UDPRoute
|
||||
|
@ -133,13 +157,32 @@ tests:
|
|||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
filters:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
asserts:
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
isKind:
|
||||
of: GRPCRoute
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
notExists:
|
||||
equal:
|
||||
path: spec.rules[0].matches
|
||||
value:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
- documentIndex: &HTTPRouteDocument 2
|
||||
equal:
|
||||
path: spec.rules[0].filters
|
||||
value:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
isKind:
|
||||
of: HTTPRoute
|
||||
|
@ -150,24 +193,42 @@ tests:
|
|||
- path:
|
||||
type: PathPrefix
|
||||
value: /test
|
||||
- documentIndex: &HTTPRouteDocument 3
|
||||
equal:
|
||||
path: spec.rules[0].filters
|
||||
value:
|
||||
- type: URLRewrite
|
||||
urlRewrite:
|
||||
path:
|
||||
type: ReplacePrefixMatch
|
||||
replacePrefixMatch: ""
|
||||
- documentIndex: &HTTPRouteDocument 4
|
||||
isKind:
|
||||
of: TCPRoute
|
||||
- documentIndex: &HTTPRouteDocument 4
|
||||
notExists:
|
||||
path: spec.rules[0].matches
|
||||
- documentIndex: &HTTPRouteDocument 4
|
||||
notExists:
|
||||
path: spec.rules[0].filters
|
||||
- documentIndex: &HTTPRouteDocument 5
|
||||
isKind:
|
||||
of: TLSRoute
|
||||
- documentIndex: &HTTPRouteDocument 5
|
||||
notExists:
|
||||
path: spec.rules[0].matches
|
||||
- documentIndex: &HTTPRouteDocument 5
|
||||
notExists:
|
||||
path: spec.rules[0].filters
|
||||
- documentIndex: &HTTPRouteDocument 6
|
||||
isKind:
|
||||
of: UDPRoute
|
||||
- documentIndex: &HTTPRouteDocument 6
|
||||
notExists:
|
||||
path: spec.rules[0].matches
|
||||
- documentIndex: &HTTPRouteDocument 6
|
||||
notExists:
|
||||
path: spec.rules[0].filters
|
||||
|
||||
- it: hostnames shouldn't be used for TCPRoutes and UDPRoutes
|
||||
set:
|
||||
|
|
|
@ -66,3 +66,15 @@ tests:
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue