mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat!: Rename common-chart to app-template
This commit is contained in:
parent
567577762f
commit
6a2bee4036
48 changed files with 70 additions and 70 deletions
41
charts/other/app-template/tests/container/args_test.yaml
Normal file
41
charts/other/app-template/tests/container/args_test.yaml
Normal file
|
@ -0,0 +1,41 @@
|
|||
suite: container args override
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
isNull:
|
||||
path: spec.template.spec.containers[0].args
|
||||
|
||||
- it: single string should pass
|
||||
set:
|
||||
args: sleep infinity
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- sleep infinity
|
||||
|
||||
- it: list of strings should pass
|
||||
set:
|
||||
args:
|
||||
- sleep
|
||||
- infinity
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- sleep
|
||||
- infinity
|
41
charts/other/app-template/tests/container/command_test.yaml
Normal file
41
charts/other/app-template/tests/container/command_test.yaml
Normal file
|
@ -0,0 +1,41 @@
|
|||
suite: container command override
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
isNull:
|
||||
path: spec.template.spec.containers[0].command
|
||||
|
||||
- it: single string should pass
|
||||
set:
|
||||
command: /bin/sh
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- /bin/sh
|
||||
|
||||
- it: list of strings should pass
|
||||
set:
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- /bin/sh
|
||||
- -c
|
154
charts/other/app-template/tests/container/env_test.yaml
Normal file
154
charts/other/app-template/tests/container/env_test.yaml
Normal file
|
@ -0,0 +1,154 @@
|
|||
suite: container env values
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
isNull:
|
||||
path: spec.template.spec.containers[0].env
|
||||
|
||||
- it: KeyValue string should pass
|
||||
set:
|
||||
env:
|
||||
string: value_of_env
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
value: value_of_env
|
||||
|
||||
- it: KeyValue float should pass
|
||||
set:
|
||||
env:
|
||||
string: 4.2
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
value: "4.2"
|
||||
|
||||
- it: KeyValue int should pass
|
||||
set:
|
||||
env:
|
||||
string: 1
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
value: "1"
|
||||
|
||||
- it: List should pass
|
||||
set:
|
||||
env:
|
||||
- name: STATIC_ENV_FROM_LIST
|
||||
value: STATIC_ENV_VALUE_FROM_LIST
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: STATIC_ENV_FROM_LIST
|
||||
value: STATIC_ENV_VALUE_FROM_LIST
|
||||
|
||||
- it: Explicit ValueFrom in list should pass
|
||||
set:
|
||||
env:
|
||||
- name: DYNAMIC_ENV_FROM_LIST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV_FROM_LIST
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
|
||||
- it: Implicit ValueFrom should pass
|
||||
set:
|
||||
env:
|
||||
DYNAMIC_ENV:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
|
||||
- it: Templated value should pass
|
||||
set:
|
||||
env:
|
||||
DYNAMIC_ENV: "{{ .Release.Name }}-admin"
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
value: RELEASE-NAME-admin
|
||||
|
||||
- it: Combined KeyValue with Explicit ValueFrom should pass
|
||||
set:
|
||||
env:
|
||||
STATIC_ENV: static
|
||||
DYNAMIC_ENV:
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[1]
|
||||
value:
|
||||
name: STATIC_ENV
|
||||
value: static
|
43
charts/other/app-template/tests/container/envfrom_test.yaml
Normal file
43
charts/other/app-template/tests/container/envfrom_test.yaml
Normal file
|
@ -0,0 +1,43 @@
|
|||
suite: container envFrom values
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
isNull:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
|
||||
- it: explicit envFrom should pass
|
||||
set:
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: myCustomSecret
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
secretRef:
|
||||
name: myCustomSecret
|
||||
|
||||
- it: from secret should pass
|
||||
set:
|
||||
secret:
|
||||
STATIC_SECRET: value_of_secret
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
secretRef:
|
||||
name: RELEASE-NAME-app-template
|
95
charts/other/app-template/tests/container/ports_test.yaml
Normal file
95
charts/other/app-template/tests/container/ports_test.yaml
Normal file
|
@ -0,0 +1,95 @@
|
|||
suite: container ports
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].ports[0]
|
||||
value:
|
||||
containerPort: null
|
||||
name: http
|
||||
protocol: TCP
|
||||
|
||||
- it: custom port should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
http:
|
||||
enabled: false
|
||||
server:
|
||||
enabled: true
|
||||
port: 8080
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].ports[0]
|
||||
value:
|
||||
containerPort: 8080
|
||||
name: server
|
||||
protocol: TCP
|
||||
|
||||
- it: HTTP protocol should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
http:
|
||||
protocol: HTTP
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].ports[0]
|
||||
value:
|
||||
containerPort: null
|
||||
name: http
|
||||
protocol: TCP
|
||||
|
||||
- it: HTTPS protocol should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
http:
|
||||
protocol: HTTPS
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].ports[0]
|
||||
value:
|
||||
containerPort: null
|
||||
name: http
|
||||
protocol: TCP
|
||||
|
||||
- it: UDP protocol should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
http:
|
||||
protocol: UDP
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].ports[0]
|
||||
value:
|
||||
containerPort: null
|
||||
name: http
|
||||
protocol: UDP
|
122
charts/other/app-template/tests/container/volumemounts_test.yaml
Normal file
122
charts/other/app-template/tests/container/volumemounts_test.yaml
Normal file
|
@ -0,0 +1,122 @@
|
|||
suite: container volumeMounts
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: no persistence should pass
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
isNull:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
|
||||
- it: default should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /config
|
||||
|
||||
- it: emptyDir should pass
|
||||
set:
|
||||
persistence:
|
||||
cache:
|
||||
enabled: true
|
||||
type: emptyDir
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: cache
|
||||
mountPath: /cache
|
||||
|
||||
- it: custom mountPath should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
mountPath: /custom
|
||||
accessMode: ReadWriteMany
|
||||
size: 1G
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /custom
|
||||
|
||||
- it: mount with subPath should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
existingClaim: myClaim
|
||||
subPath: "mySubPath"
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /config
|
||||
subPath: mySubPath
|
||||
|
||||
- it: hostPath with custom mountPath should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
type: hostPath
|
||||
mountPath: /data
|
||||
hostPath: /tmp
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /data
|
||||
|
||||
- it: hostPath mount with subPath should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
enabled: true
|
||||
type: hostPath
|
||||
hostPath: /dev
|
||||
subPath: mySubPath
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /dev
|
||||
subPath: mySubPath
|
Loading…
Add table
Add a link
Reference in a new issue