Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify case insensitive enum diff #2051

Open
danielrbradley opened this issue May 21, 2024 · 0 comments
Open

Simplify case insensitive enum diff #2051

danielrbradley opened this issue May 21, 2024 · 0 comments
Labels
impact/reliability Something that feels unreliable or flaky kind/engineering Work that is not visible to an external user

Comments

@danielrbradley
Copy link
Member

danielrbradley commented May 21, 2024

Original commit: https://github.com/pulumi/terraform-provider-azurerm/commit/5102ad61ffdce39a7fe315c975bf178f0a52c4d6

As part of the move to the 3.0 of the provider, the TF team made a
breaking change to make all enum values case sensitive

This breaks all existing Pulumi applications so we should ensure
that this is not the case for our users

This now makes up a large part of the 0005-Modify-resources.patch.

  1. Do we still need these patches - does the problem of case sensitivity still apply?
  2. If we still need these patches, could we apply them via gopatch so they're more robust?
  3. Can we remove these patches safely with a major release

Associated helper function: suppress.CaseDifferenceV2Only

Original issue: #2052

This was split between 0004-fixup-Shared-features.patch and 0005-Modify-resources.patch.

History:

  1. Originally introduced in Provider - Add the missing suppress.CaseDifference for case-insensitive string properties hashicorp/terraform-provider-azurerm#15182
  2. Customised by Stack72
  3. Removed in Refactor: Remove all usages of ThreePointOhBeta hashicorp/terraform-provider-azurerm#16812
  4. Tweaked comment by JK

Function code:

// CaseDifferenceV2Only only suppress case difference for v2.0.
func CaseDifferenceV2Only(_, old, new string, _ *schema.ResourceData) bool {
	// FORK: Force attributes to maintain case-insensitivity to avoid breaking changes in Pulumi programs.
	return strings.EqualFold(old, new)
}
@danielrbradley danielrbradley added impact/reliability Something that feels unreliable or flaky kind/engineering Work that is not visible to an external user labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact/reliability Something that feels unreliable or flaky kind/engineering Work that is not visible to an external user
Projects
None yet
Development

No branches or pull requests

1 participant