feat(common): Release version 2.0.0-beta.1 (#173)

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2023-09-13 11:24:23 +02:00 committed by GitHub
parent 19767d668c
commit 7b6ee00be6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
189 changed files with 3110 additions and 3023 deletions

View file

@ -1,22 +0,0 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
ingress:
main:
enabled: true
probes:
liveness:
enabled: true
readiness:
enabled: true
startup:
enabled: true

View file

@ -1,33 +0,0 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
ingress:
main:
enabled: true
persistence:
config:
enabled: true
emptyDir:
enabled: true
mountPath: /www/assets
addons:
codeserver:
enabled: true
git:
deployKey: test
workingDir: "/www/assets"
ingress:
enabled: true
volumeMounts:
- name: config
mountPath: /www/assets

View file

@ -1,11 +0,0 @@
controller:
type: cronjob
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
enabled: false

View file

@ -1,26 +0,0 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
ports:
http:
port: 8080
ingress:
main:
enabled: true
probes:
liveness:
enabled: true
readiness:
enabled: true
startup:
enabled: true
addons:
netshoot:
enabled: true

View file

@ -1,20 +0,0 @@
image:
repository: b4bz/homer
tag: latest
pullPolicy: IfNotPresent
service:
main:
enabled: false
ingress:
main:
enabled: false
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false

View file

@ -1,167 +0,0 @@
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: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: &AddonServiceDocument 0
isKind:
of: Service
- documentIndex: &ApplicationServiceDocument 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-addon-codeserver
- 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 3
isKind:
of: Secret
- 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: RELEASE-NAME-addon-codeserver-deploykey
- documentIndex: *AddonDeployKeySecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-addon-codeserver-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 3
isKind:
of: Secret
- 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: RELEASE-NAME-addon-codeserver-deploykey
- documentIndex: *AddonDeployKeySecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-addon-codeserver-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

View file

@ -1,38 +0,0 @@
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

View file

@ -1,206 +0,0 @@
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: gluetun
- it: addon enabled with configFile should pass
set:
addons:
vpn:
enabled: true
configFile: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &AddonVPNConfigSecretDocument 2
isKind:
of: Secret
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/config.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-addon-vpn-config
- documentIndex: *AddonVPNConfigSecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-addon-vpn-config
- it: addon enabled with up/down scripts should pass
set:
addons:
vpn:
enabled: true
scripts:
up: |
test_up
down: |
test_down
asserts:
- hasDocuments:
count: 3
- documentIndex: &AddonVPNConfigConfigMapDocument 2
isKind:
of: ConfigMap
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/scripts/up.sh
name: vpnscript
subPath: up.sh
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /gluetun/scripts/down.sh
name: vpnscript
subPath: down.sh
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
configMap:
items:
- key: up.sh
mode: 511
path: up.sh
- key: down.sh
mode: 511
path: down.sh
name: RELEASE-NAME-addon-vpn
name: vpnscript
- documentIndex: *AddonVPNConfigConfigMapDocument
equal:
path: metadata.name
value: RELEASE-NAME-addon-vpn
- 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: /gluetun/config.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 custom env vars dict should pass
set:
addons:
vpn:
enabled: true
env:
int: 1
float: 1.5
string: value_of_env
template: "{{ .Release.Name }}-admin"
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[1].name
value: vpn
- 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

View file

@ -1,93 +0,0 @@
suite: configmap metadata
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
configMaps:
config:
enabled: true
asserts:
- hasDocuments:
count: 3
- documentIndex: &ConfigmapDocument 2
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- it: custom metadata should pass
set:
configMaps:
config:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &ConfigmapDocument 2
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
configMaps:
config:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &ConfigmapDocument 2
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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,91 +0,0 @@
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:
configMaps:
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:
configMaps:
config:
enabled: true
data:
foo: bar
secondary:
enabled: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &FirstConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *FirstConfigmapDocument
isNotNull:
path: metadata.name
- documentIndex: &SecondConfigmapDocument 3
isKind:
of: ConfigMap
- documentIndex: *SecondConfigmapDocument
isNotNull:
path: metadata.name
- it: default name should pass
set:
configMaps:
config:
enabled: true
asserts:
- hasDocuments:
count: 3
- documentIndex: &ConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
equal:
path: metadata.name
value: RELEASE-NAME-config
- it: with nameOverride should pass
set:
configMaps:
config:
enabled: true
nameOverride: http
asserts:
- hasDocuments:
count: 3
- documentIndex: &ConfigmapDocument 2
isKind:
of: ConfigMap
- documentIndex: *ConfigmapDocument
equal:
path: metadata.name
value: RELEASE-NAME-http

View file

@ -1,20 +0,0 @@
suite: configmap Pod metadata
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
configMaps:
config:
enabled: true
data:
test: value 1
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: spec.template.metadata.annotations
value:
checksum/config: afdf20f511621d5cb358c5e8b0da2d14cdbe2549fb12fa123f6a6e9baabef26e

View file

@ -1,73 +0,0 @@
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: multiline string should pass
set:
args: |
echo hello
echo world
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].args
value:
- |
echo hello
echo world
- it: single quoted 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
- "test"
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].args
value:
- sleep
- infinity
- test

View file

@ -1,71 +0,0 @@
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: multiline string 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
- it: single quoted 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

View file

@ -1,154 +0,0 @@
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

View file

@ -1,28 +0,0 @@
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

View file

@ -1,31 +0,0 @@
suite: container image tag
templates:
- common.yaml
tests:
- it: string tag should pass
set:
image:
repository: b4bz/homer
tag: latest
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].image
value: b4bz/homer:latest
- it: integer tag should pass
set:
image:
repository: b4bz/homer
tag: 1.23
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].image
value: b4bz/homer:1.23

View file

@ -1,95 +0,0 @@
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

View file

@ -1,468 +0,0 @@
suite: container probes
templates:
- common.yaml
tests:
- it: default should pass
set:
service:
main:
ports:
http:
enabled: true
port: &port 80
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
initialDelaySeconds: 0
periodSeconds: 5
tcpSocket:
port: *port
timeoutSeconds: 1
- it: custom primary port should pass
set:
service:
main:
ports:
http:
enabled: true
port: 80
test:
enabled: true
primary: true
port: &port 8080
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
initialDelaySeconds: 0
periodSeconds: 5
tcpSocket:
port: *port
timeoutSeconds: 1
- it: default with string Service port should pass
set:
service:
main:
ports:
http:
enabled: true
port: "80"
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: 80
timeoutSeconds: 1
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: 80
timeoutSeconds: 1
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
initialDelaySeconds: 0
periodSeconds: 5
tcpSocket:
port: 80
timeoutSeconds: 1
- it: disabled service should pass
set:
service:
main:
enabled: false
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
isNull:
path: spec.template.spec.containers[0].livenessProbe
- documentIndex: 0
isNull:
path: spec.template.spec.containers[0].readinessProbe
- documentIndex: 0
isNull:
path: spec.template.spec.containers[0].startupProbe
- it: AUTO type probe should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
liveness:
enabled: true
type: AUTO
path: /api/version
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
path: /api/version
port: *port
scheme: HTTP
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
- it: HTTP type probe should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
liveness:
enabled: true
type: HTTP
path: /api/version
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
path: /api/version
port: *port
scheme: HTTP
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
- it: HTTPS type probe should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
liveness:
enabled: true
type: HTTPS
path: /api/version
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
path: /api/version
port: *port
scheme: HTTPS
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
- it: custom liveness probe should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
liveness:
enabled: true
custom: true
spec:
httpGet:
path: /api/version
port: *port
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
httpGet:
path: /api/version
port: *port
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
- it: custom readiness probe should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
readiness:
enabled: true
custom: true
spec:
httpGet:
path: /api/version
port: *port
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].readinessProbe
value:
httpGet:
path: /api/version
port: *port
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
- it: custom startup probe should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
startup:
enabled: true
custom: true
spec:
httpGet:
path: /api/version
port: *port
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].startupProbe
value:
httpGet:
path: /api/version
port: *port
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
- it: User-defined liveness probe port should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
liveness:
enabled: true
port: &port http
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- it: User-defined liveness probe port should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
liveness:
enabled: true
port: &port http
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].livenessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- it: User-defined readiness probe port should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
readiness:
enabled: true
port: &port http
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].readinessProbe
value:
failureThreshold: 3
initialDelaySeconds: 0
periodSeconds: 10
tcpSocket:
port: *port
timeoutSeconds: 1
- it: User-defined startup probe port should pass
set:
service:
main:
ports:
http:
port: &port 80
probes:
startup:
enabled: true
port: &port http
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[0].startupProbe
value:
failureThreshold: 30
initialDelaySeconds: 0
periodSeconds: 5
tcpSocket:
port: *port
timeoutSeconds: 1

View file

@ -1,122 +0,0 @@
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

View file

@ -1,75 +0,0 @@
suite: cronjob configuration
templates:
- common.yaml
tests:
- it: default cronjob configuration should pass
set:
controller:
type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.schedule
value: "*/20 * * * *"
- documentIndex: *ControllerDoc
equal:
path: spec.concurrencyPolicy
value: Forbid
- documentIndex: *ControllerDoc
equal:
path: spec.successfulJobsHistoryLimit
value: 1
- documentIndex: *ControllerDoc
equal:
path: spec.failedJobsHistoryLimit
value: 1
- documentIndex: *ControllerDoc
isNull:
path: spec.jobTemplate.spec.ttlSecondsAfterFinished
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: Never
- it: custom cronjob configuration should pass
set:
controller:
type: cronjob
restartPolicy: OnFailure
cronjob:
schedule: &CronJobSchedule "0 3 * * *"
concurrencyPolicy: &CronJobConcurrencyPolicy "Test"
failedJobsHistory: &CronJobFailedJobsHistory 2
successfulJobsHistory: &CronJobSuccessfulJobsHistory 3
ttlSecondsAfterFinished: &ttlSecondsAfterFinished 3600
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.schedule
value: *CronJobSchedule
- documentIndex: *ControllerDoc
equal:
path: spec.concurrencyPolicy
value: *CronJobConcurrencyPolicy
- documentIndex: *ControllerDoc
equal:
path: spec.successfulJobsHistoryLimit
value: *CronJobSuccessfulJobsHistory
- documentIndex: *ControllerDoc
equal:
path: spec.failedJobsHistoryLimit
value: *CronJobFailedJobsHistory
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.ttlSecondsAfterFinished
value: *ttlSecondsAfterFinished
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.spec.restartPolicy
value: OnFailure

View file

@ -1,107 +0,0 @@
suite: controller metadata cronjob
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
controller.type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- it: custom metadata should pass
set:
controller:
type: cronjob
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
controller:
type: cronjob
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- 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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test
- it: jobTemplate metadata should pass
set:
controller.type: cronjob
podAnnotations:
test_annotation: test
podLabels:
test_label: test
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.metadata.annotations
value:
test_annotation: test
- documentIndex: *ControllerDoc
equal:
path: spec.jobTemplate.spec.template.metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
test_label: test

View file

@ -1,83 +0,0 @@
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,83 +0,0 @@
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,83 +0,0 @@
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,68 +0,0 @@
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
- it: daemonset should pass
set:
controller.type: daemonset
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: DaemonSet
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- it: statefulset should pass
set:
controller.type: statefulset
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: StatefulSet
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- it: cronjob should pass
set:
controller.type: cronjob
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: CronJob
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- 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

View file

@ -1,83 +0,0 @@
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,71 +0,0 @@
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

View file

@ -1,43 +0,0 @@
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:
service:
name: RELEASE-NAME
port:
number: 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:
service:
name: pathService
port:
number: 1234

View file

@ -1,91 +0,0 @@
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
- it: tls enabled with secret template evaluate empty should pass
set:
ingress.main:
enabled: true
tls:
- secretName: '{{ "" }}'
hosts:
- hostname
asserts:
- documentIndex: &IngressDocument 2
isKind:
of: Ingress
- documentIndex: *IngressDocument
equal:
path: spec.tls[0]
value:
hosts:
- hostname

View file

@ -1,72 +0,0 @@
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"

View file

@ -1,25 +0,0 @@
suite: nameOverride tests
templates:
- common.yaml
tests:
- it: default name is set to release name
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME
- it: global.nameOverride can be set
set:
global.nameOverride: custom-name
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: metadata.name
value: RELEASE-NAME-custom-name

View file

@ -1,78 +0,0 @@
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
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
- 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-suffix

View file

@ -1,60 +0,0 @@
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

View file

@ -1,45 +0,0 @@
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

View file

@ -1,127 +0,0 @@
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 \"bjw-s.common.lib.chart.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-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

View file

@ -1,38 +0,0 @@
suite: persistence volumeclaimtemplates
templates:
- common.yaml
tests:
- it: volumeClaimTemplates should pass
set:
controller:
type: 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

View file

@ -1,35 +0,0 @@
suite: pod security
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
isNull:
path: spec.template.spec.hostIPC
- it: hostIPC disabled should pass
set:
hostIPC: false
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
isNull:
path: spec.template.spec.hostIPC
- it: hostIPC enabled should pass
set:
hostIPC: true
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.hostIPC
value: true

View file

@ -1,35 +0,0 @@
suite: pod security
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
isNull:
path: spec.template.spec.hostPID
- it: hostPID disabled should pass
set:
hostPID: false
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
isNull:
path: spec.template.spec.hostPID
- it: hostPID enabled should pass
set:
hostPID: true
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.hostPID
value: true

View file

@ -1,83 +0,0 @@
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

View file

@ -1,59 +0,0 @@
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

View file

@ -1,25 +0,0 @@
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

View file

@ -1,112 +0,0 @@
suite: pod sidecar containers
templates:
- common.yaml
tests:
- it: with explicit name should pass
set:
sidecars:
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:
sidecars:
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:
sidecars:
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
sidecars:
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
- it: with legacy additionalContainers should pass
set:
sidecars:
additional1:
name: sidecar
additionalContainers:
additional2:
name: legacy-sidecar
asserts:
- documentIndex: 0
isKind:
of: Deployment
- documentIndex: 0
equal:
path: spec.template.spec.containers[1].name
value: sidecar
- documentIndex: 0
equal:
path: spec.template.spec.containers[2].name
value: legacy-sidecar

View file

@ -1,106 +0,0 @@
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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
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: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,66 +0,0 @@
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-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
- 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-custom

View file

@ -1,42 +0,0 @@
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: ""

View file

@ -1,93 +0,0 @@
suite: route metadata
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
route.main:
enabled: true
parentRefs:
- name: test
namespace: test
asserts:
- documentIndex: &routeDocument 2
isKind:
of: HTTPRoute
- documentIndex: *routeDocument
isNull:
path: metadata.annotations
- documentIndex: *routeDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- it: custom metadata should pass
set:
route.main:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
parentRefs:
- name: test
namespace: test
asserts:
- documentIndex: &routeDocument 2
isKind:
of: HTTPRoute
- documentIndex: *routeDocument
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *routeDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
route.main:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
parentRefs:
- name: test
namespace: test
asserts:
- documentIndex: &routeDocument 2
isKind:
of: HTTPRoute
- documentIndex: *routeDocument
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *routeDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,84 +0,0 @@
suite: route presence
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: 0
not: true
isKind:
of: HTTPRoute
- documentIndex: 1
not: true
isKind:
of: HTTPRoute
- it: explicitly disabled should pass
set:
route.main.enabled: false
asserts:
- hasDocuments:
count: 2
- documentIndex: 0
not: true
isKind:
of: HTTPRoute
- documentIndex: 1
not: true
isKind:
of: HTTPRoute
- it: explicitly enabled should pass
set:
route.main:
enabled: true
parentRefs:
- name: test
namespace: test
asserts:
- hasDocuments:
count: 3
- documentIndex: 0
not: true
isKind:
of: HTTPRoute
- documentIndex: 1
not: true
isKind:
of: HTTPRoute
- documentIndex: 2
isKind:
of: HTTPRoute
- it: multiple enabled should pass
set:
route:
main:
enabled: true
parentRefs:
- name: main
namespace: main
test:
enabled: true
parentRefs:
- name: test
namespace: test
asserts:
- hasDocuments:
count: 4
- documentIndex: 0
not: true
isKind:
of: HTTPRoute
- documentIndex: 1
not: true
isKind:
of: HTTPRoute
- documentIndex: 2
isKind:
of: HTTPRoute
- documentIndex: 3
isKind:
of: HTTPRoute

View file

@ -1,54 +0,0 @@
suite: ingress service reference
templates:
- common.yaml
tests:
- it: default should pass
set:
route.main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: *HTTPRouteDocument
equal:
path: spec.rules[0].backendRefs[0]
value:
group: ""
kind: Service
name: RELEASE-NAME
namespace: NAMESPACE
port: null
weight: 1
- it: custom service reference should pass
set:
route.main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- group: test
name: pathService
port: 1234
namespace: serviceNamespace
weight: 123
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: *HTTPRouteDocument
equal:
path: spec.rules[0].backendRefs[0]
value:
group: test
kind: Service
name: pathService
namespace: serviceNamespace
port: 1234
weight: 123

View file

@ -1,212 +0,0 @@
suite: route values
templates:
- common.yaml
tests:
- it: setting gateway should pass
set:
route.main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: *HTTPRouteDocument
equal:
path: spec.parentRefs[0].name
value: parentName
- documentIndex: *HTTPRouteDocument
equal:
path: spec.parentRefs[0].namespace
value: parentNamespace
- it: custom host and path should pass
set:
route.main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
hostnames:
- chart-test.local
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: *HTTPRouteDocument
equal:
path: spec.hostnames[0]
value: chart-test.local
- it: path matches should only be used for HTTPRoutes
set:
route:
main:
enabled: true
kind: HTTPRoute
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- name: test
namespace: test
matches:
- path:
type: PathPrefix
value: /test
grpc:
enabled: true
kind: GRPCRoute
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- name: test
namespace: test
matches:
- path:
type: PathPrefix
value: /test
tcp:
enabled: true
kind: TCPRoute
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- name: test
namespace: test
matches:
- path:
type: PathPrefix
value: /test
tls:
enabled: true
kind: TLSRoute
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- name: test
namespace: test
matches:
- path:
type: PathPrefix
value: /test
udp:
enabled: true
kind: UDPRoute
parentRefs:
- name: parentName
namespace: parentNamespace
rules:
- backendRefs:
- name: test
namespace: test
matches:
- path:
type: PathPrefix
value: /test
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: GRPCRoute
- documentIndex: &HTTPRouteDocument 2
isNull:
path: spec.rules[0].matches
- documentIndex: &HTTPRouteDocument 3
isKind:
of: HTTPRoute
- documentIndex: &HTTPRouteDocument 3
equal:
path: spec.rules[0].matches
value:
- path:
type: PathPrefix
value: /test
- documentIndex: &HTTPRouteDocument 4
isKind:
of: TCPRoute
- documentIndex: &HTTPRouteDocument 4
isNull:
path: spec.rules[0].matches
- documentIndex: &HTTPRouteDocument 5
isKind:
of: TLSRoute
- documentIndex: &HTTPRouteDocument 5
isNull:
path: spec.rules[0].matches
- documentIndex: &HTTPRouteDocument 6
isKind:
of: UDPRoute
- documentIndex: &HTTPRouteDocument 6
isNull:
path: spec.rules[0].matches
- it: hostnames shouldn't be used for TCPRoutes and UDPRoutes
set:
route:
main:
enabled: true
kind: TCPRoute
hostnames:
- chart-test.local
parentRefs:
- name: parentName
namespace: parentNamespace
udp:
enabled: true
kind: UDPRoute
hostnames:
- chart-test.local
parentRefs:
- name: parentName
namespace: parentNamespace
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: TCPRoute
- documentIndex: &HTTPRouteDocument 2
isNull:
path: spec.hostnames
- documentIndex: &HTTPRouteDocument 3
isKind:
of: UDPRoute
- documentIndex: &HTTPRouteDocument 3
isNull:
path: spec.hostnames
- it: sectionName in parentRefs should be optional
set:
route:
main:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
second:
enabled: true
parentRefs:
- name: parentName
namespace: parentNamespace
sectionName: parentSection
asserts:
- documentIndex: &HTTPRouteDocument 2
isKind:
of: HTTPRoute
- documentIndex: &HTTPRouteDocument 2
isNull:
path: spec.parentRefs[0].sectionName
- documentIndex: &HTTPRouteDocument 3
isKind:
of: HTTPRoute
- documentIndex: &HTTPRouteDocument 3
equal:
path: spec.parentRefs[0].sectionName
value: parentSection

View file

@ -1,110 +0,0 @@
suite: secret metadata
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
secrets:
secret:
enabled: true
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 2
isKind:
of: Secret
- documentIndex: *SecretDocument
isNull:
path: metadata.annotations
- documentIndex: *SecretDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- it: custom metadata should pass
set:
secrets:
secret:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 2
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: metadata.annotations
value:
test_annotation: test
- documentIndex: *SecretDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
test_label: test
- it: custom metadata with global metadata should pass
set:
global:
labels:
global_label: test
annotations:
global_annotation: test
secrets:
secret:
enabled: true
annotations:
test_annotation: test
labels:
test_label: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 2
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: metadata.annotations
value:
global_annotation: test
test_annotation: test
- documentIndex: *SecretDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test
- it: custom secret type should pass
set:
secrets:
secret:
enabled: true
type: &type kubernetes.io/service-account-token
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 2
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: type
value: *type

View file

@ -1,91 +0,0 @@
suite: secret names
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: 0
not: true
isKind:
of: Secret
- documentIndex: 1
not: true
isKind:
of: Secret
- it: with disabled secret should pass
set:
secrets:
secret:
enabled: false
asserts:
- hasDocuments:
count: 2
- documentIndex: 0
not: true
isKind:
of: Secret
- documentIndex: 1
not: true
isKind:
of: Secret
- it: with multiple secrets should pass
set:
secrets:
secret:
enabled: true
data:
foo: bar
secondary:
enabled: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &FirstSecretDocument 2
isKind:
of: Secret
- documentIndex: *FirstSecretDocument
isNotNull:
path: metadata.name
- documentIndex: &SecondSecretDocument 3
isKind:
of: Secret
- documentIndex: *SecondSecretDocument
isNotNull:
path: metadata.name
- it: default name should pass
set:
secrets:
secret:
enabled: true
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 2
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-secret
- it: with nameOverride should pass
set:
secrets:
secret:
enabled: true
nameOverride: http
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 2
isKind:
of: Secret
- documentIndex: *SecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-http

View file

@ -1,25 +0,0 @@
suite: secret Pod metadata
templates:
- common.yaml
tests:
- it: default metadata should pass
set:
secrets:
secret_1:
enabled: true
data:
test: value 1
secret_2:
enabled: true
data:
test_1: value 1
test_2: value 2
asserts:
- documentIndex: &ControllerDoc 0
isKind:
of: Deployment
- documentIndex: *ControllerDoc
equal:
path: spec.template.metadata.annotations
value:
checksum/secrets: cd4e5076088172611ca1c43c659a275232d9eeb887acc20575ac141038b9aacb

View file

@ -1,84 +0,0 @@
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: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
- 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: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
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: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
global_label: test
helm.sh/chart: app-template-1.5.1
test_label: test

View file

@ -1,29 +0,0 @@
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
- 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-http

View file

@ -1,63 +0,0 @@
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

View file

@ -1,71 +0,0 @@
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

View file

@ -1,63 +0,0 @@
suite: service values
templates:
- common.yaml
tests:
- it: ports and services are enabled by default
set:
service:
second:
type: ClusterIP
ports:
first:
port: 80
asserts:
- hasDocuments:
count: 3
- documentIndex: &FirstServiceDocument 1
isKind:
of: Service
- documentIndex: &SecondServiceDocument 2
isKind:
of: Service
- it: services can be disabled
set:
service:
main:
enabled: false
asserts:
- hasDocuments:
count: 1
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- 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

View file

@ -1,105 +0,0 @@
suite: serviceAccount values
templates:
- common.yaml
tests:
- it: a serviceAccount is not created by default
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceAccount is not created when disabled
set:
serviceAccount:
create: false
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceAccount and Secret are created when enabled
set:
serviceAccount:
create: true
asserts:
- hasDocuments:
count: 4
- documentIndex: &ServiceAccountDocument 0
isKind:
of: ServiceAccount
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: &ServiceDocument 2
isKind:
of: Service
- documentIndex: &SecretDocument 3
isKind:
of: Secret
- documentIndex: *ServiceAccountDocument
equal:
path: metadata.name
value: &ServiceAccountName RELEASE-NAME
- documentIndex: *ServiceAccountDocument
equal:
path: secrets
value:
- name: RELEASE-NAME-sa-token
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.serviceAccountName
value: *ServiceAccountName
- documentIndex: *SecretDocument
equal:
path: metadata.annotations
value:
kubernetes.io/service-account.name: RELEASE-NAME
- it: a serviceAccount and Secret are created with custom name
set:
serviceAccount:
create: true
name: &ServiceAccountName myAccount
asserts:
- hasDocuments:
count: 4
- documentIndex: &ServiceAccountDocument 0
isKind:
of: ServiceAccount
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: &ServiceDocument 2
isKind:
of: Service
- documentIndex: &SecretDocument 3
isKind:
of: Secret
- documentIndex: *ServiceAccountDocument
equal:
path: metadata.name
value: *ServiceAccountName
- documentIndex: *ServiceAccountDocument
equal:
path: secrets
value:
- name: RELEASE-NAME-sa-token
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.serviceAccountName
value: *ServiceAccountName
- documentIndex: *SecretDocument
equal:
path: metadata.annotations
value:
kubernetes.io/service-account.name: *ServiceAccountName

View file

@ -1,151 +0,0 @@
suite: serviceMonitor values
templates:
- common.yaml
tests:
- it: a serviceMonitor is not created by default
asserts:
- hasDocuments:
count: 2
- documentIndex: &ServiceDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceMonitor is not created when disabled
set:
serviceMonitor:
main:
enabled: false
asserts:
- hasDocuments:
count: 2
- documentIndex: &ServiceDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- it: a serviceMonitor is created
set:
serviceMonitor:
main:
enabled: true
labels:
test.label: testvalue
endpoints:
- port: http
scheme: http
path: /metrics
interval: 1m
scrapeTimeout: 10s
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceMonitorDocument 2
isKind:
of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.endpoints
value:
- port: http
scheme: http
path: /metrics
interval: 1m
scrapeTimeout: 10s
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.labels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: RELEASE-NAME
helm.sh/chart: app-template-1.5.1
test.label: testvalue
- it: a serviceMonitor is created with nameOverride
set:
serviceMonitor:
main:
enabled: true
nameOverride: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceMonitorDocument 2
isKind:
of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.name
value: RELEASE-NAME-test
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
- it: a serviceMonitor is created with a templated service
set:
serviceMonitor:
main:
enabled: true
serviceName: "{{ .Release.Name }}"
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceMonitorDocument 2
isKind:
of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.selector.matchLabels
value:
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: RELEASE-NAME
app.kubernetes.io/service: RELEASE-NAME
- it: a serviceMonitor is created with a custom selector
set:
serviceMonitor:
main:
enabled: true
selector:
mySelector:
test: "true"
asserts:
- hasDocuments:
count: 3
- documentIndex: &ServiceMonitorDocument 2
isKind:
of: ServiceMonitor
- documentIndex: *ServiceMonitorDocument
equal:
path: metadata.name
value: RELEASE-NAME
- documentIndex: *ServiceMonitorDocument
equal:
path: spec.selector
value:
mySelector:
test: "true"