mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
More paving the way
This commit is contained in:
parent
33f207c563
commit
4863146ad9
62 changed files with 2761 additions and 13 deletions
26
charts/other/kah-common-chart/.helmignore
Normal file
26
charts/other/kah-common-chart/.helmignore
Normal file
|
@ -0,0 +1,26 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
# OWNERS file for Kubernetes
|
||||
OWNERS
|
||||
# helm-docs templates
|
||||
*.gotmpl
|
16
charts/other/kah-common-chart/Chart.yaml
Normal file
16
charts/other/kah-common-chart/Chart.yaml
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
apiVersion: v2
|
||||
description: A KaH-common powered chart template. This can be useful for small projects that don't have their own chart.
|
||||
name: kah-common-chart
|
||||
version: 1.1.2
|
||||
maintainers:
|
||||
- name: bjw-s
|
||||
email: me@bjw-s.dev
|
||||
dependencies:
|
||||
- name: common
|
||||
repository: https://library-charts.k8s-at-home.com
|
||||
version: 4.4.2
|
||||
annotations:
|
||||
artifacthub.io/changes: |-
|
||||
- kind: changed
|
||||
description: Upgraded `common` chart dependency to version 4.4.2
|
9
charts/other/kah-common-chart/README_CONFIG.md.gotmpl
Normal file
9
charts/other/kah-common-chart/README_CONFIG.md.gotmpl
Normal file
|
@ -0,0 +1,9 @@
|
|||
{{- define "custom.custom.configuration.header" -}}
|
||||
## Custom configuration
|
||||
{{- end -}}
|
||||
|
||||
{{- define "custom.custom.configuration" -}}
|
||||
{{ template "custom.custom.configuration.header" . }}
|
||||
|
||||
N/A
|
||||
{{- end -}}
|
2
charts/other/kah-common-chart/templates/common.yaml
Normal file
2
charts/other/kah-common-chart/templates/common.yaml
Normal file
|
@ -0,0 +1,2 @@
|
|||
---
|
||||
{{ include "common.all" . }}
|
167
charts/other/kah-common-chart/tests/addons/codeserver_test.yaml
Normal file
167
charts/other/kah-common-chart/tests/addons/codeserver_test.yaml
Normal file
|
@ -0,0 +1,167 @@
|
|||
suite: addon codeserver
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
not: true
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: codeserver
|
||||
|
||||
- it: addon enabled should pass
|
||||
set:
|
||||
addons:
|
||||
codeserver:
|
||||
enabled: true
|
||||
volumeMounts:
|
||||
- name: "config"
|
||||
mountPath: "/data/config"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: &DeploymentDocument 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: &AddonServiceDocument 2
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].name
|
||||
value: codeserver
|
||||
- documentIndex: *AddonServiceDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: addon enabled with deployKey should pass
|
||||
set:
|
||||
addons:
|
||||
codeserver:
|
||||
enabled: true
|
||||
git:
|
||||
deployKey: test
|
||||
volumeMounts:
|
||||
- name: "config"
|
||||
mountPath: "/data/config"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: &AddonDeployKeySecretDocument 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: &DeploymentDocument 2
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.containers[1].volumeMounts
|
||||
content:
|
||||
mountPath: /root/.ssh/id_rsa
|
||||
name: deploykey
|
||||
subPath: id_rsa
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: deploykey
|
||||
secret:
|
||||
defaultMode: 256
|
||||
items:
|
||||
- key: id_rsa
|
||||
path: id_rsa
|
||||
secretName: RELEASE-NAME-common-test-deploykey
|
||||
- documentIndex: *AddonDeployKeySecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-deploykey
|
||||
|
||||
- it: addon enabled with InlineBase64 deployKey should pass
|
||||
set:
|
||||
addons:
|
||||
codeserver:
|
||||
enabled: true
|
||||
git:
|
||||
deployKeyBase64: dGVzdEtleQ==
|
||||
volumeMounts:
|
||||
- name: "config"
|
||||
mountPath: "/data/config"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: &AddonDeployKeySecretDocument 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: &DeploymentDocument 2
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.containers[1].volumeMounts
|
||||
content:
|
||||
mountPath: /root/.ssh/id_rsa
|
||||
name: deploykey
|
||||
subPath: id_rsa
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: deploykey
|
||||
secret:
|
||||
defaultMode: 256
|
||||
items:
|
||||
- key: id_rsa
|
||||
path: id_rsa
|
||||
secretName: RELEASE-NAME-common-test-deploykey
|
||||
- documentIndex: *AddonDeployKeySecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-deploykey
|
||||
|
||||
- it: addon enabled with existingSecret deployKey should pass
|
||||
set:
|
||||
addons:
|
||||
codeserver:
|
||||
enabled: true
|
||||
git:
|
||||
deployKeySecret: test-secret
|
||||
volumeMounts:
|
||||
- name: "config"
|
||||
mountPath: "/data/config"
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &DeploymentDocument 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.containers[1].volumeMounts
|
||||
content:
|
||||
mountPath: /root/.ssh/id_rsa
|
||||
name: deploykey
|
||||
subPath: id_rsa
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: deploykey
|
||||
secret:
|
||||
defaultMode: 256
|
||||
items:
|
||||
- key: id_rsa
|
||||
path: id_rsa
|
||||
secretName: test-secret
|
|
@ -0,0 +1,38 @@
|
|||
suite: addon netshoot
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
not: true
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: netshoot
|
||||
|
||||
- it: addon enabled should pass
|
||||
set:
|
||||
addons:
|
||||
netshoot:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].name
|
||||
value: netshoot
|
131
charts/other/kah-common-chart/tests/addons/vpn_test.yaml
Normal file
131
charts/other/kah-common-chart/tests/addons/vpn_test.yaml
Normal file
|
@ -0,0 +1,131 @@
|
|||
suite: addon vpn
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
not: true
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: vpn
|
||||
|
||||
- it: addon enabled should pass
|
||||
set:
|
||||
addons:
|
||||
vpn:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].name
|
||||
value: openvpn
|
||||
|
||||
- it: addon enabled with configFile should pass
|
||||
set:
|
||||
addons:
|
||||
vpn:
|
||||
enabled: true
|
||||
configFile: test
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &AddonVPNConfigSecretDocument 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: &DeploymentDocument 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.containers[1].volumeMounts
|
||||
content:
|
||||
mountPath: /vpn/vpn.conf
|
||||
name: vpnconfig
|
||||
subPath: vpnConfigfile
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: vpnconfig
|
||||
secret:
|
||||
items:
|
||||
- key: vpnConfigfile
|
||||
path: vpnConfigfile
|
||||
secretName: RELEASE-NAME-common-test-vpnconfig
|
||||
- documentIndex: *AddonVPNConfigSecretDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-vpnconfig
|
||||
|
||||
- it: addon enabled with existing configFile secret should pass
|
||||
set:
|
||||
addons:
|
||||
vpn:
|
||||
enabled: true
|
||||
configFileSecret: test-secret
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &DeploymentDocument 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.containers[1].volumeMounts
|
||||
content:
|
||||
mountPath: /vpn/vpn.conf
|
||||
name: vpnconfig
|
||||
subPath: vpnConfigfile
|
||||
- documentIndex: *DeploymentDocument
|
||||
contains:
|
||||
path: spec.template.spec.volumes
|
||||
content:
|
||||
name: vpnconfig
|
||||
secret:
|
||||
items:
|
||||
- key: vpnConfigfile
|
||||
path: vpnConfigfile
|
||||
secretName: test-secret
|
||||
|
||||
- it: addon enabled with managed secret should pass
|
||||
set:
|
||||
addons:
|
||||
vpn:
|
||||
enabled: true
|
||||
openvpn:
|
||||
auth: |
|
||||
<auth>
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &SecretDocument 0
|
||||
isKind:
|
||||
of: Secret
|
||||
- documentIndex: &DeploymentDocument 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *DeploymentDocument
|
||||
not: true
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: vpn
|
|
@ -0,0 +1,87 @@
|
|||
suite: configmap metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: &ConfigmapDocument 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *ConfigmapDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ConfigmapDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ConfigmapDocument 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *ConfigmapDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ConfigmapDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ConfigmapDocument 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: *ConfigmapDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ConfigmapDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
|
@ -0,0 +1,91 @@
|
|||
suite: configMap names
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
|
||||
- it: with disabled configMap should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
|
||||
- it: with multiple configMap should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
data:
|
||||
foo: bar
|
||||
secondary:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: 0
|
||||
isNotNull:
|
||||
path: metadata.name
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: 1
|
||||
isNotNull:
|
||||
path: metadata.name
|
||||
|
||||
- it: default name should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-config
|
||||
|
||||
- it: with nameOverride should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
nameOverride: http
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: ConfigMap
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-http
|
|
@ -0,0 +1,18 @@
|
|||
suite: configmap Pod metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
configmap:
|
||||
config:
|
||||
enabled: true
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: spec.template.metadata.annotations
|
||||
value:
|
||||
checksum/config: 13f83afec54139bc9b797ac55ba4d79494f6fd94c0159101836ef127bec95a28
|
41
charts/other/kah-common-chart/tests/container/args_test.yaml
Normal file
41
charts/other/kah-common-chart/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
|
|
@ -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
|
169
charts/other/kah-common-chart/tests/container/env_test.yaml
Normal file
169
charts/other/kah-common-chart/tests/container/env_test.yaml
Normal file
|
@ -0,0 +1,169 @@
|
|||
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: 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: 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
|
|
@ -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-common-test
|
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,83 @@
|
|||
suite: controller metadata daemonset
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
controller.type: daemonset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
controller:
|
||||
type: daemonset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
controller:
|
||||
type: daemonset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
|
@ -0,0 +1,83 @@
|
|||
suite: controller metadata deployment
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
controller.type: deployment
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
controller:
|
||||
type: deployment
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
controller:
|
||||
type: deployment
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
|
@ -0,0 +1,83 @@
|
|||
suite: controller metadata statefulset
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
controller.type: statefulset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
controller:
|
||||
type: statefulset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
controller:
|
||||
type: statefulset
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
|
@ -0,0 +1,56 @@
|
|||
suite: controller types
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: daemonset should pass
|
||||
set:
|
||||
controller.type: daemonset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: statefulset should pass
|
||||
set:
|
||||
controller.type: statefulset
|
||||
asserts:
|
||||
- documentIndex: &ControllerDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: disabled should pass
|
||||
set:
|
||||
controller.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- documentIndex: &ControllerDoc 0
|
||||
not: true
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *ControllerDoc
|
||||
not: true
|
||||
isKind:
|
||||
of: DaemonSet
|
||||
- documentIndex: *ControllerDoc
|
||||
not: true
|
||||
isKind:
|
||||
of: Controller
|
|
@ -0,0 +1,83 @@
|
|||
suite: ingress metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
ingress.main:
|
||||
enabled: true
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
|
@ -0,0 +1,71 @@
|
|||
suite: ingress presence
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
|
||||
- it: explicitly disabled should pass
|
||||
set:
|
||||
ingress.main.enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
|
||||
- it: explicitly enabled should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
|
||||
- it: multiple enabled should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
ingress.test.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 4
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: 3
|
||||
isKind:
|
||||
of: Ingress
|
|
@ -0,0 +1,39 @@
|
|||
suite: ingress service reference
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
serviceName: RELEASE-NAME-common-test
|
||||
servicePort: null
|
||||
|
||||
- it: custom service reference should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: /
|
||||
service:
|
||||
name: pathService
|
||||
port: 1234
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].backend
|
||||
value:
|
||||
serviceName: pathService
|
||||
servicePort: 1234
|
72
charts/other/kah-common-chart/tests/ingress/tls_test.yaml
Normal file
72
charts/other/kah-common-chart/tests/ingress/tls_test.yaml
Normal file
|
@ -0,0 +1,72 @@
|
|||
suite: ingress tls
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
isNull:
|
||||
path: spec.tls
|
||||
|
||||
- it: tls enabled should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
tls:
|
||||
- secretName: test
|
||||
hosts:
|
||||
- hostname
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.tls[0]
|
||||
value:
|
||||
secretName: test
|
||||
hosts:
|
||||
- hostname
|
||||
|
||||
- it: tls enabled without secret should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
tls:
|
||||
- hosts:
|
||||
- hostname
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.tls[0]
|
||||
value:
|
||||
hosts:
|
||||
- hostname
|
||||
|
||||
- it: tls enabled with secret template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
tls:
|
||||
- secretName: "{{ .Release.Name }}-secret"
|
||||
hosts:
|
||||
- hostname
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.tls[0]
|
||||
value:
|
||||
secretName: RELEASE-NAME-secret
|
||||
hosts:
|
||||
- hostname
|
72
charts/other/kah-common-chart/tests/ingress/values_test.yaml
Normal file
72
charts/other/kah-common-chart/tests/ingress/values_test.yaml
Normal file
|
@ -0,0 +1,72 @@
|
|||
suite: ingress values
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
ingress.main.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: chart-example.local
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/"
|
||||
|
||||
- it: custom host and path should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: /test
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: chart-test.local
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/test"
|
||||
|
||||
- it: host with template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: "{{ .Release.Name }}.hostname"
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].host
|
||||
value: RELEASE-NAME.hostname
|
||||
|
||||
- it: path with template should pass
|
||||
set:
|
||||
ingress.main:
|
||||
enabled: true
|
||||
hosts:
|
||||
- host: chart-test.local
|
||||
paths:
|
||||
- path: "/{{ .Release.Name }}.path"
|
||||
asserts:
|
||||
- documentIndex: &IngressDocument 2
|
||||
isKind:
|
||||
of: Ingress
|
||||
- documentIndex: *IngressDocument
|
||||
equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/RELEASE-NAME.path"
|
|
@ -0,0 +1,78 @@
|
|||
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-common-test-config
|
||||
|
||||
- it: with existingClaim should pass
|
||||
set:
|
||||
persistence:
|
||||
existingClaim:
|
||||
enabled: true
|
||||
existingClaim: myClaim
|
||||
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
|
||||
asserts:
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: claimWithoutSuffix
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME-common-test
|
||||
|
||||
- it: custom suffix should pass
|
||||
set:
|
||||
persistence:
|
||||
claimWithNameOverride:
|
||||
enabled: true
|
||||
nameOverride: suffix
|
||||
accessMode: ReadWriteMany
|
||||
size: 1G
|
||||
asserts:
|
||||
- documentIndex: 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: claimWithNameOverride
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME-common-test-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,45 @@
|
|||
suite: persistence hostpath
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: hostPath should pass
|
||||
set:
|
||||
persistence:
|
||||
hostpathmounts-data:
|
||||
enabled: true
|
||||
type: hostPath
|
||||
hostPath: "/tmp1"
|
||||
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"
|
||||
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
|
127
charts/other/kah-common-chart/tests/persistence/types_test.yaml
Normal file
127
charts/other/kah-common-chart/tests/persistence/types_test.yaml
Normal file
|
@ -0,0 +1,127 @@
|
|||
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
|
||||
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
|
||||
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 \"common.names.fullname\" $ }}-config"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.template.spec.volumes[0]
|
||||
value:
|
||||
name: configmap
|
||||
configMap:
|
||||
name: RELEASE-NAME-common-test-config
|
||||
|
||||
- it: secret persistence type should pass
|
||||
set:
|
||||
persistence:
|
||||
secret:
|
||||
enabled: true
|
||||
type: secret
|
||||
name: mySettings
|
||||
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"
|
||||
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
|
||||
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,30 @@
|
|||
suite: persistence volumeclaimtemplates
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: volumeClaimTemplates should pass
|
||||
set:
|
||||
controller:
|
||||
type: statefulset
|
||||
volumeClaimTemplates:
|
||||
- name: "storage"
|
||||
accessMode: "ReadWriteOnce"
|
||||
size: "10Gi"
|
||||
storageClass: "storage"
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec.volumeClaimTemplates[0]
|
||||
value:
|
||||
metadata:
|
||||
name: storage
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
storageClassName: storage
|
|
@ -0,0 +1,45 @@
|
|||
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
|
|
@ -0,0 +1,45 @@
|
|||
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
|
59
charts/other/kah-common-chart/tests/pod/network_test.yaml
Normal file
59
charts/other/kah-common-chart/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/kah-common-chart/tests/pod/replicas_test.yaml
Normal file
25
charts/other/kah-common-chart/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
|
106
charts/other/kah-common-chart/tests/pvc/metadata_test.yaml
Normal file
106
charts/other/kah-common-chart/tests/pvc/metadata_test.yaml
Normal file
|
@ -0,0 +1,106 @@
|
|||
suite: pvc metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
persistence.config.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: retain enabled should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
retain: true
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
helm.sh/resource-policy: keep
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
labels:
|
||||
test_label: test
|
||||
annotations:
|
||||
test_annotation: test
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
persistence.config:
|
||||
enabled: true
|
||||
labels:
|
||||
test_label: test
|
||||
annotations:
|
||||
test_annotation: test
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
global_annotation: test
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
66
charts/other/kah-common-chart/tests/pvc/names_test.yaml
Normal file
66
charts/other/kah-common-chart/tests/pvc/names_test.yaml
Normal file
|
@ -0,0 +1,66 @@
|
|||
suite: pvc names
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: disabled should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: 0
|
||||
not: true
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
|
||||
- it: default should pass
|
||||
set:
|
||||
persistence.config.enabled: true
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 3
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: 1
|
||||
not: true
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: 2
|
||||
not: true
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-config
|
||||
|
||||
- it: without suffix should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
nameOverride: "-"
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: with custom suffix should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
nameOverride: "custom"
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-custom
|
|
@ -0,0 +1,42 @@
|
|||
suite: pvc storageclass
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
set:
|
||||
persistence.config.enabled: true
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
isNull:
|
||||
path: spec.storageClassName
|
||||
|
||||
- it: custom should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
storageClass: custom
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: spec.storageClassName
|
||||
value: custom
|
||||
|
||||
- it: empty should pass
|
||||
set:
|
||||
persistence.config:
|
||||
enabled: true
|
||||
storageClass: "-"
|
||||
asserts:
|
||||
- documentIndex: &PersistentVolumeClaimDocument 0
|
||||
isKind:
|
||||
of: PersistentVolumeClaim
|
||||
- documentIndex: *PersistentVolumeClaimDocument
|
||||
equal:
|
||||
path: spec.storageClassName
|
||||
value: ""
|
|
@ -0,0 +1,81 @@
|
|||
suite: service metadata
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default metadata should pass
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
|
||||
- it: custom metadata should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
test_annotation: test
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
||||
|
||||
- it: custom metadata with global metadata should pass
|
||||
set:
|
||||
global:
|
||||
labels:
|
||||
global_label: test
|
||||
annotations:
|
||||
global_annotation: test
|
||||
service:
|
||||
main:
|
||||
annotations:
|
||||
test_annotation: test
|
||||
labels:
|
||||
test_label: test
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
global_annotation: test
|
||||
test_annotation: test
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.labels
|
||||
value:
|
||||
app.kubernetes.io/instance: RELEASE-NAME
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/name: common-test
|
||||
global_label: test
|
||||
helm.sh/chart: common-test-0.1.0
|
||||
test_label: test
|
29
charts/other/kah-common-chart/tests/service/names_test.yaml
Normal file
29
charts/other/kah-common-chart/tests/service/names_test.yaml
Normal file
|
@ -0,0 +1,29 @@
|
|||
suite: service names
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test
|
||||
|
||||
- it: custom name suffix should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
nameOverride: http
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-common-test-http
|
|
@ -0,0 +1,63 @@
|
|||
suite: service port names
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0]
|
||||
value:
|
||||
name: http
|
||||
port: null
|
||||
protocol: TCP
|
||||
targetPort: http
|
||||
|
||||
- it: custom name should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
http:
|
||||
enabled: false
|
||||
server:
|
||||
enabled: true
|
||||
port: 8080
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0]
|
||||
value:
|
||||
name: server
|
||||
port: 8080
|
||||
protocol: TCP
|
||||
targetPort: server
|
||||
|
||||
- it: custom target port should pass
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
ports:
|
||||
http:
|
||||
enabled: true
|
||||
targetPort: 80
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0]
|
||||
value:
|
||||
name: http
|
||||
port: null
|
||||
protocol: TCP
|
||||
targetPort: 80
|
|
@ -0,0 +1,71 @@
|
|||
suite: service protocols
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
|
||||
- it: explicit TCP should pass
|
||||
set:
|
||||
service.main.ports.http.protocol: TCP
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
|
||||
- it: explicit UDP should pass
|
||||
set:
|
||||
service.main.ports.http.protocol: UDP
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: UDP
|
||||
|
||||
- it: explicit HTTP should pass
|
||||
set:
|
||||
service.main.ports.http.protocol: HTTP
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
- documentIndex: *ServiceDocument
|
||||
isNull:
|
||||
path: metadata.annotations
|
||||
|
||||
- it: explicit HTTPS should pass
|
||||
set:
|
||||
service.main.ports.http.protocol: HTTPS
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.ports[0].protocol
|
||||
value: TCP
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
traefik.ingress.kubernetes.io/service.serversscheme: https
|
33
charts/other/kah-common-chart/tests/service/values_test.yaml
Normal file
33
charts/other/kah-common-chart/tests/service/values_test.yaml
Normal file
|
@ -0,0 +1,33 @@
|
|||
suite: service values
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
- it: externalTrafficPolicy should pass for NodePort service
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
type: NodePort
|
||||
externalTrafficPolicy: Local
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.externalTrafficPolicy
|
||||
value: Local
|
||||
|
||||
- it: externalTrafficPolicy should pass for LoadBalancer service
|
||||
set:
|
||||
service:
|
||||
main:
|
||||
type: LoadBalancer
|
||||
externalTrafficPolicy: Local
|
||||
asserts:
|
||||
- documentIndex: &ServiceDocument 1
|
||||
isKind:
|
||||
of: Service
|
||||
- documentIndex: *ServiceDocument
|
||||
equal:
|
||||
path: spec.externalTrafficPolicy
|
||||
value: Local
|
1
charts/other/kah-common-chart/values.yaml
Normal file
1
charts/other/kah-common-chart/values.yaml
Normal file
|
@ -0,0 +1 @@
|
|||
---
|
Loading…
Add table
Add a link
Reference in a new issue