Skip to content

Commit

Permalink
change maxUnavailable to integer (#535)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rule88 and tvoran committed Jun 1, 2021
1 parent 828b312 commit 4588760
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions test/unit/server-ha-disruptionbudget.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}
5 changes: 4 additions & 1 deletion values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,10 @@
"type": "boolean"
},
"maxUnavailable": {
"type": "null"
"type": [
"null",
"integer"
]
}
}
},
Expand Down

0 comments on commit 4588760

Please sign in to comment.