chore: helm_release do not allow duplicate set values #1612
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.
The Helm provider currently (v.2.17.0 and v3.0.0-pre2) allows multiple
setblocks with the same name (e.g., twosetblocks withname = "defaultSSLPolicy") just like Helm. However, with the Terraform provider this creates unpredictable and non-intuitive behavior when configuring Helm releases.Specifically:
This leads to confusing behavior where users might expect later blocks to override earlier ones (as Helm works), but instead, the result is unpredictable from the user's perspective.
For example:
In this case, which SSL policy will be used is not deterministic from the user's perspective, making it difficult for users to control their configuration.
Solution
This PR changes the behavior so it explicitly validate that each name is only used once, providing a clear error message if duplicates are found.
This makes the behavior more intuitive and explicit, helping users avoid subtle configuration errors.
I'd consider this breaking change, but figured I'd submit it anyway as you're about to release
v3.0.0of the provider, so this could fit there.