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
|
@ -0,0 +1,91 @@
|
|||
suite: pod additional containers
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: with explicit name should pass
|
||||
set:
|
||||
additionalContainers:
|
||||
additional1:
|
||||
name: template-test
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].name
|
||||
value: template-test
|
||||
|
||||
- it: with implicit name should pass
|
||||
set:
|
||||
additionalContainers:
|
||||
additional1:
|
||||
image: template-test
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].name
|
||||
value: additional1
|
||||
|
||||
- it: with templated name should pass
|
||||
set:
|
||||
additionalContainers:
|
||||
additional1:
|
||||
name: "{{ .Release.Name }}-container"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].name
|
||||
value: RELEASE-NAME-container
|
||||
|
||||
- it: with custom env vars dict should pass
|
||||
set:
|
||||
env:
|
||||
main_env: value
|
||||
additionalContainers:
|
||||
additional1:
|
||||
env:
|
||||
int: 1
|
||||
float: 1.5
|
||||
string: value_of_env
|
||||
template: "{{ .Release.Name }}-admin"
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: main_env
|
||||
value: "value"
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].env[0]
|
||||
value:
|
||||
name: float
|
||||
value: "1.5"
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].env[1]
|
||||
value:
|
||||
name: int
|
||||
value: "1"
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].env[2]
|
||||
value:
|
||||
name: string
|
||||
value: value_of_env
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].env[3]
|
||||
value:
|
||||
name: template
|
||||
value: RELEASE-NAME-admin
|
83
charts/other/app-template/tests/pod/initcontainers_test.yaml
Normal file
83
charts/other/app-template/tests/pod/initcontainers_test.yaml
Normal file
|
@ -0,0 +1,83 @@
|
|||
suite: pod initContainers
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: with explicit name should pass
|
||||
set:
|
||||
initContainers:
|
||||
init1:
|
||||
name: template-test
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: template-test
|
||||
|
||||
- it: with implicit name should pass
|
||||
set:
|
||||
initContainers:
|
||||
init1:
|
||||
image: template-test
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: init1
|
||||
|
||||
- it: with templated name should pass
|
||||
set:
|
||||
initContainers:
|
||||
init1:
|
||||
name: "{{ .Release.Name }}-container"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].name
|
||||
value: RELEASE-NAME-container
|
||||
|
||||
- it: with custom env vars dict should pass
|
||||
set:
|
||||
initContainers:
|
||||
init1:
|
||||
env:
|
||||
int: 1
|
||||
float: 1.5
|
||||
string: value_of_env
|
||||
template: "{{ .Release.Name }}-admin"
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].env[0]
|
||||
value:
|
||||
name: float
|
||||
value: "1.5"
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].env[1]
|
||||
value:
|
||||
name: int
|
||||
value: "1"
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].env[2]
|
||||
value:
|
||||
name: string
|
||||
value: value_of_env
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.initContainers[0].env[3]
|
||||
value:
|
||||
name: template
|
||||
value: RELEASE-NAME-admin
|
59
charts/other/app-template/tests/pod/network_test.yaml
Normal file
59
charts/other/app-template/tests/pod/network_test.yaml
Normal file
|
@ -0,0 +1,59 @@
|
|||
suite: pod replicas
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
isNull:
|
||||
path: spec.template.spec.hostNetwork
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.dnsPolicy
|
||||
value: ClusterFirst
|
||||
|
||||
- it: hostNetwork disabled should pass
|
||||
set:
|
||||
hostNetwork: false
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
isNull:
|
||||
path: spec.template.spec.hostNetwork
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.dnsPolicy
|
||||
value: ClusterFirst
|
||||
|
||||
- it: hostNetwork enabled should pass
|
||||
set:
|
||||
hostNetwork: true
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.hostNetwork
|
||||
value: true
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.dnsPolicy
|
||||
value: ClusterFirstWithHostNet
|
||||
|
||||
- it: custom dnsPolicy should pass
|
||||
set:
|
||||
dnsPolicy: None
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.dnsPolicy
|
||||
value: None
|
25
charts/other/app-template/tests/pod/replicas_test.yaml
Normal file
25
charts/other/app-template/tests/pod/replicas_test.yaml
Normal file
|
@ -0,0 +1,25 @@
|
|||
suite: pod replicas
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.replicas
|
||||
value: 1
|
||||
|
||||
- it: custom replicas should pass
|
||||
set:
|
||||
controller.replicas: 3
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.replicas
|
||||
value: 3
|
Loading…
Add table
Add a link
Reference in a new issue