chart(redis-cluster): only render pdb.maxUnavailable / minAvailable when set#1749
Open
SAY-5 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
Open
chart(redis-cluster): only render pdb.maxUnavailable / minAvailable when set#1749SAY-5 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
SAY-5 wants to merge 1 commit intoOT-CONTAINER-KIT:mainfrom
Conversation
…hen set The _helpers.tpl PDB block unconditionally rendered both maxUnavailable and minAvailable from values.yaml, which the chart defaults to (1, 1). When a user enabled the PDB without clearing one of them, the RedisCluster CR carried both fields and the operator propagated them to the PodDisruptionBudget controller, which rejects the object: PodDisruptionBudget.policy is invalid: spec: Invalid value: minAvailable and maxUnavailable cannot be both set RedisCluster reconciliation then loops on the failed PDB and the follower StatefulSets are never created (OT-CONTAINER-KIT#1745). Guard each field with `{{- if .pdb.<field> }}` so users who explicitly set only one keep the charts' behaviour they asked for, and setting both still renders both (preserving current behaviour for deliberately-configured overrides). Signed-off-by: SAY-5 <SAY-5@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1745.
The
_helpers.tplPDB block unconditionally rendered bothmaxUnavailableandminAvailablefromvalues.yaml, which the chart defaults to(1, 1):When a user enabled the PDB without clearing one of them, the RedisCluster CR carried both fields and the operator propagated them to the PodDisruptionBudget controller, which rejects the object:
RedisCluster reconciliation then loops on the failed PDB and follower StatefulSets are never created.
Fix
Guard each field with
{{- if .pdb.<field> }}so users who explicitly set only one keep the chart behaviour they asked for, while setting both still renders both (preserving current behaviour for deliberately-configured overrides).Test plan
maxUnavailable, onlyminAvailable, both)helm lint charts/redis-cluster(nohelmavailable in my local env; left for CI)