Implement injector deployment topology spread UTs

* also remove string from the relevant schema types
This commit is contained in:
Eric Miller 2021-11-22 15:12:17 -06:00
parent 8840187301
commit f49ecb6802
2 changed files with 24 additions and 4 deletions

View file

@ -452,6 +452,27 @@ load _helpers
[ "${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

View file

@ -370,8 +370,7 @@
"topologySpreadConstraints": {
"type": [
"null",
"array",
"string"
"array"
]
},
"webhookAnnotations": {