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:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-11-20 20:33:30 +01:00 committed by GitHub
parent 8bfc33eb8a
commit 0eac5ba7d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 638 additions and 17 deletions

View file

@ -1 +0,0 @@
../../../../examples/helm/values.yaml

View file

@ -0,0 +1,62 @@
controllers:
main:
strategy: Recreate
containers:
main:
image:
# -- image repository
repository: vaultwarden/server
# -- image tag
# this example is not automatically updated, so be sure to use the latest image
tag: 1.25.2
# -- image pull policy
pullPolicy: IfNotPresent
# -- environment variables.
# See [image docs](https://github.com/dani-garcia/vaultwarden/blob/main/.env.template) for more details.
env:
# -- Config dir
DATA_FOLDER: "config"
# -- Configures service settings for the chart.
service:
main:
ports:
http:
port: 80
websocket:
enabled: true
port: 3012
ingress:
# -- Enable and configure ingress settings for the chart under this key.
main:
enabled: true
hosts:
- host: chart-example.local
paths:
- path: /
pathType: Prefix
service:
name: main
port: http
- path: /notifications/hub/negotiate
pathType: Prefix
service:
name: main
port: http
- path: /notifications/hub
pathType: Prefix
service:
name: main
port: websocket
# -- Configure persistence settings for the chart under this key.
persistence:
config:
enabled: true
type: persistentVolumeClaim
accessMode: ReadWriteOnce
size: 1Gi
mountPath: /config

View file

@ -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:

View file

@ -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

View 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

View file

@ -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:

View file

@ -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