Implement injector HA statefulset topology UTs
This commit is contained in:
parent
567a4386a5
commit
102c29955b
3 changed files with 28 additions and 2 deletions
|
@ -458,7 +458,7 @@ load _helpers
|
||||||
@test "injector/deployment: topologySpreadConstraints is null by default" {
|
@test "injector/deployment: topologySpreadConstraints is null by default" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
--show-only templates/injector-deployment.yaml \
|
--show-only templates/injector-deployment.yaml \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec | .topologySpreadConstraints? == null' | tee /dev/stderr)
|
yq '.spec.template.spec | .topologySpreadConstraints? == null' | tee /dev/stderr)
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,6 +540,32 @@ load _helpers
|
||||||
[ "${actual}" = "1" ]
|
[ "${actual}" = "1" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# topologySpreadConstraints
|
||||||
|
|
||||||
|
@test "server/ha-StatefulSet: topologySpreadConstraints is null by default" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-statefulset.yaml \
|
||||||
|
--set 'server.ha.enabled=true' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq '.spec.template.spec | .topologySpreadConstraints? == null' | tee /dev/stderr)
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "server/ha-StatefulSet: topologySpreadConstraints can be set as YAML" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/server-statefulset.yaml \
|
||||||
|
--set 'server.ha.enabled=true' \
|
||||||
|
--set "server.topologySpreadConstraints[0].foo=bar,server.topologySpreadConstraints[1].baz=qux" \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq '.spec.template.spec.topologySpreadConstraints == [{"foo": "bar"}, {"baz": "qux"}]' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "true" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
#--------------------------------------------------------------------
|
||||||
|
# tolerations
|
||||||
|
|
||||||
@test "server/ha-StatefulSet: tolerations not set by default" {
|
@test "server/ha-StatefulSet: tolerations not set by default" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
|
|
|
@ -790,7 +790,7 @@ load _helpers
|
||||||
@test "server/standalone-StatefulSet: topologySpreadConstraints is null by default" {
|
@test "server/standalone-StatefulSet: topologySpreadConstraints is null by default" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
--show-only templates/server-statefulset.yaml \
|
--show-only templates/server-statefulset.yaml \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec | .topologySpreadConstraints? == null' | tee /dev/stderr)
|
yq '.spec.template.spec | .topologySpreadConstraints? == null' | tee /dev/stderr)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue