change maxUnavailable to integer (#535)

change maxUnavailable from `null` to `integer` to enable upgrade from
0.11.0 to 0.12.0 when using the specific variable.

* Also allow null value

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>

* add test for server.ha.disruptionBudget.maxUnavailable

Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
This commit is contained in:
Rule88 2021-06-01 19:51:18 +02:00 committed by GitHub
parent 828b31287b
commit 458876007a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -85,3 +85,15 @@ load _helpers
yq '.spec.maxUnavailable' | tee /dev/stderr)
[ "${actual}" = "2" ]
}
@test "server/DisruptionBudget: correct maxUnavailable with custom value" {
cd `chart_dir`
local actual=$(helm template \
--show-only templates/server-disruptionbudget.yaml \
--set 'server.ha.enabled=true' \
--set 'server.ha.replicas=3' \
--set 'server.ha.disruptionBudget.maxUnavailable=2' \
. | tee /dev/stderr |
yq '.spec.maxUnavailable' | tee /dev/stderr)
[ "${actual}" = "2" ]
}

View file

@ -484,7 +484,10 @@
"type": "boolean"
},
"maxUnavailable": {
"type": "null"
"type": [
"null",
"integer"
]
}
}
},