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
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -370,8 +370,7 @@
|
||||||
"topologySpreadConstraints": {
|
"topologySpreadConstraints": {
|
||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
"array",
|
"array"
|
||||||
"string"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"webhookAnnotations": {
|
"webhookAnnotations": {
|
||||||
|
|
Loading…
Reference in a new issue