mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release common 4.0.0 (#398)
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
This commit is contained in:
parent
1e210f43e3
commit
a01a89cb13
327 changed files with 11181 additions and 7330 deletions
|
@ -1,29 +1,27 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container args override
|
||||
suite: container - fields - args
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].args
|
||||
|
||||
- it: single string should pass
|
||||
set:
|
||||
controllers.main.containers.main.args: sleep infinity
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- sleep infinity
|
||||
|
@ -33,12 +31,11 @@ tests:
|
|||
controllers.main.containers.main.args: |
|
||||
echo hello
|
||||
echo world
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- |-
|
||||
|
@ -48,12 +45,11 @@ tests:
|
|||
- it: single quoted string should pass
|
||||
set:
|
||||
controllers.main.containers.main.args: "sleep infinity"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- sleep infinity
|
||||
|
@ -64,12 +60,11 @@ tests:
|
|||
- sleep
|
||||
- infinity
|
||||
- "test"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- sleep
|
||||
|
@ -80,12 +75,11 @@ tests:
|
|||
set:
|
||||
controllers.main.defaultContainerOptions:
|
||||
args: value_of_args
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- value_of_args
|
||||
|
@ -97,12 +91,11 @@ tests:
|
|||
controllers.main.containers.main.args:
|
||||
- value 1
|
||||
- value 2
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].args
|
||||
value:
|
||||
- value 1
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container command override
|
||||
suite: container - fields - command
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].command
|
||||
|
||||
- it: single string should pass
|
||||
set:
|
||||
controllers.main.containers.main.command: /bin/sh
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- /bin/sh
|
||||
|
@ -33,12 +31,11 @@ tests:
|
|||
controllers.main.containers.main.command: |
|
||||
/bin/sh
|
||||
-c
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- |-
|
||||
|
@ -48,12 +45,11 @@ tests:
|
|||
- it: single quoted string should pass
|
||||
set:
|
||||
controllers.main.containers.main.command: "/bin/sh"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- /bin/sh
|
||||
|
@ -63,12 +59,11 @@ tests:
|
|||
controllers.main.containers.main.command:
|
||||
- /bin/sh
|
||||
- "-c"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- /bin/sh
|
||||
|
@ -78,12 +73,11 @@ tests:
|
|||
set:
|
||||
controllers.main.defaultContainerOptions:
|
||||
command: value_of_command
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- value_of_command
|
||||
|
@ -95,12 +89,11 @@ tests:
|
|||
controllers.main.containers.main.command:
|
||||
- value 1
|
||||
- value 2
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].command
|
||||
value:
|
||||
- value 1
|
||||
|
|
|
@ -1,30 +1,28 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container env values
|
||||
suite: container - fields - env
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].env
|
||||
|
||||
- it: KeyValue string should pass
|
||||
set:
|
||||
controllers.main.containers.main.env:
|
||||
string: value_of_env
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
|
@ -34,12 +32,11 @@ tests:
|
|||
set:
|
||||
controllers.main.containers.main.env:
|
||||
string: 4.2
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
|
@ -49,12 +46,11 @@ tests:
|
|||
set:
|
||||
controllers.main.containers.main.env:
|
||||
string: 1
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
|
@ -65,12 +61,11 @@ tests:
|
|||
controllers.main.containers.main.env:
|
||||
- name: STATIC_ENV_FROM_LIST
|
||||
value: STATIC_ENV_VALUE_FROM_LIST
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: STATIC_ENV_FROM_LIST
|
||||
|
@ -83,12 +78,11 @@ tests:
|
|||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV_FROM_LIST
|
||||
|
@ -102,12 +96,11 @@ tests:
|
|||
- name: DYNAMIC_ENV_FROM_LIST
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV_FROM_LIST
|
||||
|
@ -121,12 +114,11 @@ tests:
|
|||
DYNAMIC_ENV:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
|
@ -143,18 +135,16 @@ tests:
|
|||
secretKeyRef:
|
||||
name: "{{ .Release.Name }}-secret"
|
||||
key: "{{ .Release.Name }}-key"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
value: RELEASE-NAME-admin
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[1]
|
||||
value:
|
||||
name: TEMPLATE_ENV
|
||||
|
@ -171,20 +161,18 @@ tests:
|
|||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[1]
|
||||
value:
|
||||
name: STATIC_ENV
|
||||
|
@ -207,32 +195,28 @@ tests:
|
|||
dependsOn:
|
||||
- DYNAMIC_ENV
|
||||
- ORDERED_ENV
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: STATIC_ENV
|
||||
value: "1"
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[1]
|
||||
value:
|
||||
name: DYNAMIC_ENV
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[2]
|
||||
value:
|
||||
name: ORDERED_ENV
|
||||
value: "true"
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[3]
|
||||
value:
|
||||
name: DEPENDENT_ENV
|
||||
|
@ -243,12 +227,11 @@ tests:
|
|||
controllers.main.defaultContainerOptions:
|
||||
env:
|
||||
string: value_of_env
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: string
|
||||
|
@ -261,12 +244,11 @@ tests:
|
|||
string: value_of_env
|
||||
controllers.main.containers.main.env:
|
||||
someThingElse: value_of_env
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].env[0]
|
||||
value:
|
||||
name: someThingElse
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container envFrom values
|
||||
suite: container - fields - envFrom
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].envFrom
|
||||
|
||||
- it: explicit envFrom should pass
|
||||
|
@ -23,19 +22,17 @@ tests:
|
|||
prefix: test
|
||||
- configMapRef:
|
||||
name: myCustomConfig
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
secretRef:
|
||||
name: myCustomSecret
|
||||
prefix: test
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[1]
|
||||
value:
|
||||
configMapRef:
|
||||
|
@ -50,19 +47,17 @@ tests:
|
|||
prefix: test
|
||||
- configMapRef:
|
||||
name: myCustomConfig
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
secretRef:
|
||||
name: myCustomSecret
|
||||
prefix: test
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[1]
|
||||
value:
|
||||
configMapRef:
|
||||
|
@ -81,19 +76,17 @@ tests:
|
|||
- secretRef:
|
||||
name: myCustomSecretOverride
|
||||
prefix: test
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
secretRef:
|
||||
name: myCustomSecretOverride
|
||||
prefix: test
|
||||
- documentIndex: *DeploymentDoc
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].envFrom[1]
|
||||
|
||||
- it: envFrom configmap identifier reference should pass
|
||||
|
@ -107,23 +100,21 @@ tests:
|
|||
config:
|
||||
data:
|
||||
test: test
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
configMapRef:
|
||||
name: RELEASE-NAME-config
|
||||
name: release-name
|
||||
prefix: test
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[1]
|
||||
value:
|
||||
configMapRef:
|
||||
name: RELEASE-NAME-config
|
||||
name: release-name
|
||||
|
||||
- it: envFrom Secret identifier reference should pass
|
||||
set:
|
||||
|
@ -137,23 +128,21 @@ tests:
|
|||
secret:
|
||||
stringData:
|
||||
test: test
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
secretRef:
|
||||
name: RELEASE-NAME-secret
|
||||
name: release-name
|
||||
prefix: test
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[1]
|
||||
value:
|
||||
secretRef:
|
||||
name: RELEASE-NAME-secret
|
||||
name: release-name
|
||||
prefix: test
|
||||
|
||||
- it: envFrom with templated name reference should pass
|
||||
|
@ -165,30 +154,26 @@ tests:
|
|||
- secret: "{{ .Release.Name }}-secret"
|
||||
- secretRef:
|
||||
name: "{{ .Release.Name }}-secret2"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[0]
|
||||
value:
|
||||
configMapRef:
|
||||
name: RELEASE-NAME-config
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[1]
|
||||
value:
|
||||
configMapRef:
|
||||
name: RELEASE-NAME-config2
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[2]
|
||||
value:
|
||||
secretRef:
|
||||
name: RELEASE-NAME-secret
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].envFrom[3]
|
||||
value:
|
||||
secretRef:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container image tag
|
||||
suite: container - fields - image
|
||||
templates:
|
||||
- common.yaml
|
||||
tests:
|
||||
|
@ -11,12 +11,11 @@ tests:
|
|||
controllers.main.containers.main.image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: latest
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: ghcr.io/mendhak/http-https-echo:latest
|
||||
|
||||
|
@ -27,12 +26,11 @@ tests:
|
|||
controllers.main.containers.main.image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: 1.23
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: ghcr.io/mendhak/http-https-echo:1.23
|
||||
|
||||
|
@ -43,12 +41,11 @@ tests:
|
|||
controllers.main.containers.main.image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: "{{.Chart.Version}}"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: ghcr.io/mendhak/http-https-echo:1.0.0
|
||||
|
||||
|
@ -61,12 +58,11 @@ tests:
|
|||
tag: 32
|
||||
containers:
|
||||
main: {} # needed to have at least a container enabled
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: ghcr.io/mendhak/http-https-echo:32
|
||||
|
||||
|
@ -78,11 +74,10 @@ tests:
|
|||
controllers.main.containers.main.image:
|
||||
repository: ghcr.io/mendhak/http-https-echo-override
|
||||
tag: 33
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].image
|
||||
value: ghcr.io/mendhak/http-https-echo-override:33
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container name
|
||||
suite: container - fields - nameOverride
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
|
@ -13,12 +13,11 @@ tests:
|
|||
nameOverride: template-test
|
||||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: template-test
|
||||
|
||||
|
@ -28,12 +27,11 @@ tests:
|
|||
main:
|
||||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: main
|
||||
|
||||
|
@ -44,11 +42,10 @@ tests:
|
|||
nameOverride: "{{ .Release.Name }}-container"
|
||||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].name
|
||||
value: RELEASE-NAME-container
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container ports
|
||||
suite: container - fields - ports
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].ports
|
||||
|
||||
- it: custom port should pass
|
||||
|
@ -25,13 +24,11 @@ tests:
|
|||
- containerPort: 8080
|
||||
name: http
|
||||
protocol: TCP
|
||||
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].ports[0]
|
||||
value:
|
||||
containerPort: 8080
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container probes
|
||||
suite: container - fields - probes
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
|
@ -13,9 +13,9 @@ set:
|
|||
|
||||
tests:
|
||||
- it: default probes
|
||||
documentSelector: &DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -51,7 +51,9 @@ tests:
|
|||
enabled: true
|
||||
primary: true
|
||||
port: 8080
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
|
@ -87,7 +89,9 @@ tests:
|
|||
- it: probes with string Service port
|
||||
set:
|
||||
service.main.ports.http.port: "80"
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -144,37 +148,37 @@ tests:
|
|||
asserts:
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME-main
|
||||
value: release-name-main
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe.tcpSocket.port
|
||||
value: 8081
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME-main
|
||||
value: release-name-main
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].readinessProbe.tcpSocket.port
|
||||
value: 8081
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME-main
|
||||
value: release-name-main
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.tcpSocket.port
|
||||
value: 8081
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME-other
|
||||
value: release-name-other
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe.tcpSocket.port
|
||||
value: 8080
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME-other
|
||||
value: release-name-other
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].readinessProbe.tcpSocket.port
|
||||
value: 8080
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: RELEASE-NAME-other
|
||||
value: release-name-other
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].startupProbe.tcpSocket.port
|
||||
value: 8080
|
||||
|
@ -185,7 +189,9 @@ tests:
|
|||
main:
|
||||
enabled: false
|
||||
controller: main
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -202,7 +208,9 @@ tests:
|
|||
enabled: true
|
||||
type: AUTO
|
||||
path: /api/version
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
|
@ -227,7 +235,9 @@ tests:
|
|||
enabled: true
|
||||
type: HTTP
|
||||
path: /api/version
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -248,7 +258,9 @@ tests:
|
|||
enabled: true
|
||||
type: HTTPS
|
||||
path: /api/version
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -268,7 +280,9 @@ tests:
|
|||
liveness:
|
||||
enabled: true
|
||||
type: GRPC
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -287,7 +301,9 @@ tests:
|
|||
enabled: true
|
||||
type: GRPC
|
||||
service: test
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -314,7 +330,9 @@ tests:
|
|||
periodSeconds: 10
|
||||
timeoutSeconds: 1
|
||||
failureThreshold: 3
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].livenessProbe
|
||||
|
@ -341,7 +359,9 @@ tests:
|
|||
periodSeconds: 10
|
||||
timeoutSeconds: 1
|
||||
failureThreshold: 3
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].readinessProbe
|
||||
|
@ -368,7 +388,9 @@ tests:
|
|||
periodSeconds: 10
|
||||
timeoutSeconds: 1
|
||||
failureThreshold: 3
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe
|
||||
|
@ -387,7 +409,9 @@ tests:
|
|||
liveness:
|
||||
enabled: true
|
||||
port: http
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
|
@ -406,7 +430,9 @@ tests:
|
|||
readiness:
|
||||
enabled: true
|
||||
port: http
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].readinessProbe
|
||||
|
@ -424,7 +450,9 @@ tests:
|
|||
startup:
|
||||
enabled: true
|
||||
port: http
|
||||
documentSelector: *DeploymentSelector
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].startupProbe
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container resources
|
||||
suite: container - fields - resources
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
|
||||
- it: defaultContainerOption should pass
|
||||
|
@ -28,18 +27,16 @@ tests:
|
|||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: 31
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
value:
|
||||
requests:
|
||||
memory: 1Gi
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].resources
|
||||
value:
|
||||
requests:
|
||||
|
@ -63,18 +60,16 @@ tests:
|
|||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: 31
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
value:
|
||||
requests:
|
||||
memory: 2Gi
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].resources
|
||||
value:
|
||||
requests:
|
||||
|
@ -96,18 +91,16 @@ tests:
|
|||
resources:
|
||||
requests:
|
||||
memory: 2Gi
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
value:
|
||||
requests:
|
||||
memory: 1Gi
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.initContainers[0].resources
|
||||
value:
|
||||
requests:
|
||||
|
@ -127,16 +120,14 @@ tests:
|
|||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: 31
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].resources
|
||||
value:
|
||||
requests:
|
||||
memory: 1Gi
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.initContainers[0].resources
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container restartPolicy
|
||||
suite: container - fields - restartPolicy
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].restartPolicy
|
||||
|
||||
- it: custom restartPolicy should pass
|
||||
|
@ -20,12 +19,10 @@ tests:
|
|||
controllers.main.containers:
|
||||
main:
|
||||
restartPolicy: Always
|
||||
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].restartPolicy
|
||||
value: Always
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container securityContext
|
||||
suite: container - fields - securityContext
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
|
||||
- it: defaultContainerOption should pass
|
||||
|
@ -23,12 +22,11 @@ tests:
|
|||
securityContext:
|
||||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
value:
|
||||
runAsUser: 1000
|
||||
|
@ -47,12 +45,11 @@ tests:
|
|||
securityContext:
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
value:
|
||||
runAsUser: 568
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container stdin
|
||||
suite: container - fields - stdin
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].stdin
|
||||
|
||||
- it: custom stdin should pass
|
||||
|
@ -20,11 +19,10 @@ tests:
|
|||
controllers.main.containers:
|
||||
main:
|
||||
stdin: true
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].stdin
|
||||
value: true
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container tty
|
||||
suite: container - fields - tty
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].tty
|
||||
|
||||
- it: custom tty should pass
|
||||
|
@ -20,11 +19,10 @@ tests:
|
|||
controllers.main.containers:
|
||||
main:
|
||||
tty: true
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].tty
|
||||
value: true
|
||||
|
|
|
@ -1,18 +1,17 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container volumeMounts
|
||||
suite: container - fields - volumeMounts
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: no persistence should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
|
||||
- it: default should pass
|
||||
|
@ -21,12 +20,11 @@ tests:
|
|||
config:
|
||||
accessMode: ReadWriteOnce
|
||||
size: 1Gi
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
|
@ -47,7 +45,6 @@ tests:
|
|||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: 31
|
||||
|
||||
persistence:
|
||||
data:
|
||||
type: configMap
|
||||
|
@ -69,12 +66,10 @@ tests:
|
|||
- path: /second-pod/config.yaml
|
||||
readOnly: false
|
||||
subPath: config.yaml
|
||||
|
||||
asserts:
|
||||
- documentIndex: &FirstDeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *FirstDeploymentDoc
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name-main
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
value:
|
||||
|
@ -84,7 +79,9 @@ tests:
|
|||
name: data
|
||||
subPath: config.yaml
|
||||
mountPropagation: HostToContainer
|
||||
- documentIndex: *FirstDeploymentDoc
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name-main
|
||||
equal:
|
||||
path: spec.template.spec.containers[1].volumeMounts
|
||||
value:
|
||||
|
@ -93,10 +90,9 @@ tests:
|
|||
- mountPath: /appdata/config
|
||||
name: data
|
||||
readOnly: true
|
||||
- documentIndex: &SecondDeploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *SecondDeploymentDoc
|
||||
- documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name-second
|
||||
equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
value:
|
||||
|
@ -111,12 +107,11 @@ tests:
|
|||
persistence:
|
||||
cache:
|
||||
type: emptyDir
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: cache
|
||||
|
@ -130,12 +125,11 @@ tests:
|
|||
size: 1G
|
||||
globalMounts:
|
||||
- path: /custom
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 1
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
|
@ -149,18 +143,36 @@ tests:
|
|||
globalMounts:
|
||||
- path: /config
|
||||
subPath: "mySubPath"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /config
|
||||
subPath: mySubPath
|
||||
|
||||
- it: mount with subPathExpr should pass
|
||||
set:
|
||||
persistence:
|
||||
config:
|
||||
existingClaim: myClaim
|
||||
globalMounts:
|
||||
- path: /config
|
||||
subPathExpr: $(POD_NAME)
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
mountPath: /config
|
||||
subPathExpr: $(POD_NAME)
|
||||
|
||||
- it: hostPath with custom mountPath should pass
|
||||
set:
|
||||
persistence:
|
||||
|
@ -169,12 +181,11 @@ tests:
|
|||
hostPath: /tmp
|
||||
globalMounts:
|
||||
- path: /data
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
|
@ -188,12 +199,11 @@ tests:
|
|||
hostPath: /dev
|
||||
globalMounts:
|
||||
- subPath: mySubPath
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &DeploymentDoc 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: *DeploymentDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: config
|
||||
|
@ -210,12 +220,11 @@ tests:
|
|||
accessMode: "ReadWriteOnce"
|
||||
size: "10Gi"
|
||||
storageClass: "storage"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "StatefulSet")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &StatefulSetDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: storage
|
||||
|
@ -234,18 +243,16 @@ tests:
|
|||
globalMounts:
|
||||
- path: /tmp/storage
|
||||
- path: /tmp/secondMountPoint
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "StatefulSet")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &StatefulSetDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[0]
|
||||
value:
|
||||
name: storage
|
||||
mountPath: /tmp/storage
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].volumeMounts[1]
|
||||
value:
|
||||
name: storage
|
||||
|
@ -270,21 +277,18 @@ tests:
|
|||
image:
|
||||
repository: ghcr.io/mendhak/http-https-echo
|
||||
tag: 31
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "StatefulSet")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: &StatefulSetDoc 0
|
||||
isKind:
|
||||
of: StatefulSet
|
||||
- documentIndex: *StatefulSetDoc
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].volumeMounts
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[1].volumeMounts[0]
|
||||
value:
|
||||
name: storage
|
||||
mountPath: /tmp/storage
|
||||
- documentIndex: *StatefulSetDoc
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[1].volumeMounts[1]
|
||||
value:
|
||||
name: storage
|
|
@ -1,40 +1,37 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: container workingDir override
|
||||
suite: container - fields - workingDir
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
- ../_values/controllers_main_default_container.yaml
|
||||
tests:
|
||||
- it: default should pass
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
notExists:
|
||||
- notExists:
|
||||
path: spec.template.spec.containers[0].workingDir
|
||||
|
||||
- it: string should pass
|
||||
set:
|
||||
controllers.main.containers.main.workingDir: /work
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].workingDir
|
||||
value: /work
|
||||
|
||||
- it: quoted string should pass
|
||||
set:
|
||||
controllers.main.containers.main.workingDir: "/work"
|
||||
documentSelector:
|
||||
path: $[?(@.kind == "Deployment")].metadata.name
|
||||
value: release-name
|
||||
asserts:
|
||||
- documentIndex: 0
|
||||
isKind:
|
||||
of: Deployment
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].workingDir
|
||||
value: /work
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
|
||||
suite: Container validations
|
||||
suite: container - validations
|
||||
templates:
|
||||
- common.yaml
|
||||
values:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue