Implement injector deployment topology spread UTs
* also remove string from the relevant schema types
This commit is contained in:
parent
8840187301
commit
f49ecb6802
2 changed files with 24 additions and 4 deletions
|
@ -168,7 +168,7 @@ load _helpers
|
||||||
[ "${value}" = "RELEASE-NAME-vault-agent-injector-svc,RELEASE-NAME-vault-agent-injector-svc.${namespace:-default},RELEASE-NAME-vault-agent-injector-svc.${namespace:-default}.svc" ]
|
[ "${value}" = "RELEASE-NAME-vault-agent-injector-svc,RELEASE-NAME-vault-agent-injector-svc.${namespace:-default},RELEASE-NAME-vault-agent-injector-svc.${namespace:-default}.svc" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "injector/deployment: manual TLS adds volume mount" {
|
@test "injector/deployment: manual TLS adds volume mount" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local object=$(helm template \
|
local object=$(helm template \
|
||||||
--show-only templates/injector-deployment.yaml \
|
--show-only templates/injector-deployment.yaml \
|
||||||
|
@ -452,6 +452,27 @@ load _helpers
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "true" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# topologySpreadConstraints
|
||||||
|
|
||||||
|
@test "injector/deployment: topologySpreadConstraints is null by default" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-deployment.yaml \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq '.spec.template.spec | .topologySpreadConstraints? == null' | tee /dev/stderr)
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "injector/deployment: topologySpreadConstraints can be set as YAML" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-deployment.yaml \
|
||||||
|
--set "injector.topologySpreadConstraints[0].foo=bar,injector.topologySpreadConstraints[1].baz=qux" \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq '.spec.template.spec.topologySpreadConstraints == [{"foo": "bar"}, {"baz": "qux"}]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# tolerations
|
# tolerations
|
||||||
|
|
||||||
|
@ -695,4 +716,4 @@ load _helpers
|
||||||
local value=$(echo $object |
|
local value=$(echo $object |
|
||||||
yq -r 'map(select(.name=="AGENT_INJECT_TEMPLATE_CONFIG_EXIT_ON_RETRY_FAILURE")) | .[] .value' | tee /dev/stderr)
|
yq -r 'map(select(.name=="AGENT_INJECT_TEMPLATE_CONFIG_EXIT_ON_RETRY_FAILURE")) | .[] .value' | tee /dev/stderr)
|
||||||
[ "${value}" = "false" ]
|
[ "${value}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,8 +370,7 @@
|
||||||
"topologySpreadConstraints": {
|
"topologySpreadConstraints": {
|
||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
"array",
|
"array"
|
||||||
"string"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"webhookAnnotations": {
|
"webhookAnnotations": {
|
||||||
|
|
Loading…
Reference in a new issue