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

Redis case sensitive fix #4225

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewtarry
Copy link

What this PR does / why we need it:

The current DCS instance implementation makes engine case insensitive but stores the values in sentence case. The effect is that if you create an instance with the engine set as redis it will always force a new instance because the engine in the state is Redis.

  # module.redis.huaweicloud_dcs_instance.instance_1 must be replaced
-/+ resource "huaweicloud_dcs_instance" "instance_1" {
      + access_user             = (known after apply)
      + description             = (known after apply)
      ~ engine                  = "Redis" -> "redis" # forces replacement
      ~ enterprise_project_id   = "0" -> (known after apply)
      + enterprise_project_name = (known after apply)
        # (9 unchanged attributes hidden)
    }

This change will ensure the state diff is made case insensitive for the engine

Which issue this PR fixes:
(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)
fixes #xxx

Special notes for your reviewer:

Release note:


PR Checklist

  • Tests added/passed.
  • Documentation updated.
  • Schema updated.

@@ -128,6 +128,12 @@ func ResourceDcsInstance() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
DiffSuppressFunc: func(k, old string, new string, d *schema.ResourceData) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution, it's better to use DiffSuppressFunc: utils.SuppressCaseDiffs,

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.

3 participants