From 458876007a9b8aadb762ce84605f37ec8d115904 Mon Sep 17 00:00:00 2001 From: Rule88 Date: Tue, 1 Jun 2021 19:51:18 +0200 Subject: [PATCH] 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 * add test for server.ha.disruptionBudget.maxUnavailable Co-authored-by: Theron Voran --- test/unit/server-ha-disruptionbudget.bats | 12 ++++++++++++ values.schema.json | 5 ++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/test/unit/server-ha-disruptionbudget.bats b/test/unit/server-ha-disruptionbudget.bats index f3c329ec6..6cf21f200 100755 --- a/test/unit/server-ha-disruptionbudget.bats +++ b/test/unit/server-ha-disruptionbudget.bats @@ -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" ] +} \ No newline at end of file diff --git a/values.schema.json b/values.schema.json index 2535c1d9e..e2d00454f 100644 --- a/values.schema.json +++ b/values.schema.json @@ -484,7 +484,10 @@ "type": "boolean" }, "maxUnavailable": { - "type": "null" + "type": [ + "null", + "integer" + ] } } },