mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47: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
|
@ -0,0 +1,90 @@
|
|||
suite: persistence claimnames
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME-config
|
||||
|
||||
- it: with existingClaim should pass
|
||||
set:
|
||||
persistence:
|
||||
existingClaim:
|
||||
enabled: true
|
||||
existingClaim: myClaim
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: existingClaim
|
||||
persistentVolumeClaim:
|
||||
claimName: myClaim
|
||||
|
||||
- it: disabled suffix should pass
|
||||
set:
|
||||
persistence:
|
||||
claimWithoutSuffix:
|
||||
enabled: true
|
||||
nameOverride: "-"
|
||||
accessMode: ReadWriteMany
|
||||
size: 1G
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: claimWithoutSuffix
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME
|
||||
|
||||
- it: custom suffix should pass
|
||||
set:
|
||||
persistence:
|
||||
claimWithNameOverride:
|
||||
enabled: true
|
||||
nameOverride: suffix
|
||||
accessMode: ReadWriteMany
|
||||
size: 1G
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: claimWithNameOverride
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME-suffix
|
|
@ -0,0 +1,60 @@
|
|||
suite: persistence emptydir
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default emptyDir should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
type: emptyDir
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: config
|
||||
emptyDir: {}
|
||||
|
||||
- it: emptyDir with medium should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
type: emptyDir
|
||||
medium: memory
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: config
|
||||
emptyDir:
|
||||
medium: memory
|
||||
|
||||
- it: emptyDir with medium and sizeLimit should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
type: emptyDir
|
||||
medium: memory
|
||||
sizeLimit: 1Gi
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: config
|
||||
emptyDir:
|
||||
medium: memory
|
||||
sizeLimit: 1Gi
|
|
@ -0,0 +1,51 @@
|
|||
suite: persistence hostpath
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: hostPath should pass
|
||||
set:
|
||||
persistence:
|
||||
hostpathmounts-data:
|
||||
enabled: true
|
||||
type: hostPath
|
||||
hostPath: "/tmp1"
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: hostpathmounts-data
|
||||
hostPath:
|
||||
path: /tmp1
|
||||
|
||||
- it: hostPath with type should pass
|
||||
set:
|
||||
persistence:
|
||||
hostpathmounts-with-type:
|
||||
enabled: true
|
||||
type: hostPath
|
||||
hostPath: "/tmp2"
|
||||
hostPathType: "Directory"
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data2"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: hostpathmounts-with-type
|
||||
hostPath:
|
||||
path: /tmp2
|
||||
type: Directory
|
151
charts/library/common-test/tests/persistence/types_test.yaml
Normal file
151
charts/library/common-test/tests/persistence/types_test.yaml
Normal file
|
@ -0,0 +1,151 @@
|
|||
suite: persistence types
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: custom persistence type should pass
|
||||
set:
|
||||
persistence:
|
||||
custom-mount:
|
||||
enabled: true
|
||||
type: custom
|
||||
volumeSpec:
|
||||
downwardAPI:
|
||||
items:
|
||||
- path: "labels"
|
||||
fieldRef:
|
||||
fieldPath: metadata.labels
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: custom-mount
|
||||
downwardAPI:
|
||||
items:
|
||||
- fieldRef:
|
||||
fieldPath: metadata.labels
|
||||
path: labels
|
||||
|
||||
- it: configmap persistence type should pass
|
||||
set:
|
||||
persistence:
|
||||
configmap:
|
||||
enabled: true
|
||||
type: configMap
|
||||
name: mySettings
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: configmap
|
||||
configMap:
|
||||
name: mySettings
|
||||
|
||||
- it: configmap persistence type with name template should pass
|
||||
set:
|
||||
persistence:
|
||||
configmap:
|
||||
enabled: true
|
||||
type: configMap
|
||||
name: '{{ include "bjw-s.common.lib.chart.names.fullname" $ }}-config'
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: configmap
|
||||
configMap:
|
||||
name: RELEASE-NAME-config
|
||||
|
||||
- it: secret persistence type should pass
|
||||
set:
|
||||
persistence:
|
||||
secret:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: mySettings
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: secret
|
||||
secret:
|
||||
secretName: mySettings
|
||||
|
||||
- it: secret persistence type with name template should pass
|
||||
set:
|
||||
persistence:
|
||||
secret:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: "{{ .Release.Name }}-config"
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: secret
|
||||
secret:
|
||||
secretName: RELEASE-NAME-config
|
||||
|
||||
- it: nfs persistence type should pass
|
||||
set:
|
||||
persistence:
|
||||
nfs:
|
||||
enabled: true
|
||||
type: nfs
|
||||
server: 10.10.0.8
|
||||
path: /tank/nas/library
|
||||
mounts:
|
||||
- controllers:
|
||||
- main
|
||||
mountPath: "/data"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: nfs
|
||||
nfs:
|
||||
path: /tank/nas/library
|
||||
server: 10.10.0.8
|
|
@ -0,0 +1,39 @@
|
|||
suite: persistence volumeclaimtemplates
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: volumeClaimTemplates should pass
|
||||
set:
|
||||
controllers.main:
|
||||
type: statefulset
|
||||
statefulset:
|
||||
volumeClaimTemplates:
|
||||
- name: "storage"
|
||||
accessMode: "ReadWriteOnce"
|
||||
size: "10Gi"
|
||||
storageClass: "storage"
|
||||
labels:
|
||||
test: "label"
|
||||
annotations:
|
||||
test: "annotation"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0]
|
||||
value:
|
||||
metadata:
|
||||
name: storage
|
||||
labels:
|
||||
test: "label"
|
||||
annotations:
|
||||
test: "annotation"
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
storageClassName: storage
|
Loading…
Add table
Add a link
Reference in a new issue