Skip to content

Conversation

@henkka
Copy link

@henkka henkka commented Apr 1, 2025

The Helm provider currently (v.2.17.0 and v3.0.0-pre2) allows multiple set blocks with the same name (e.g., two set blocks with name = "defaultSSLPolicy") just like Helm. However, with the Terraform provider this creates unpredictable and non-intuitive behavior when configuring Helm releases.

Specifically:

  1. When multiple blocks set the same name, the behavior is inconsistent and not aligned with user expectations
  2. Users cannot reliably predict which value will be used when the same name appears multiple times
  3. The order of blocks in the Terraform code doesn't determine which value takes precedence

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:

resource "helm_release" "example" {
  # ...
  
  set = [
    {
      name  = "defaultSSLPolicy"
      value = "ELBSecurityPolicy-TLS13-1-2-2021-06"
    }

    {
      name  = "defaultSSLPolicy"
      value = "ELBSecurityPolicy-TLS13-1-2-Res-2021-06"
    }
 
  ]
}

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.0 of the provider, so this could fit there.

@henkka henkka requested a review from a team as a code owner April 1, 2025 09:21
@hashicorp-cla-app
Copy link

hashicorp-cla-app bot commented Apr 1, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the size/M label Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant