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

Fix forces replacement on empty array #15618

Merged
merged 4 commits into from
Mar 3, 2022

Conversation

sinc59
Copy link
Contributor

@sinc59 sinc59 commented Feb 27, 2022

Trying to fix the issue #11544
This is my first commit in go language, feel free to discuss and explain any newbie errors.

We have an inconsistent plan (force replacement) on the "azurerm_container_group" resource when options or search_domains is not set (null or []).
Azure api return list as "a b c" format, when options or search_domains is empty, with the Split function the array is not empty, using the Fields function i have a true empty array and an consistent plan (tested through local build and dev_overrides).

Sébastien

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks for this @sinc59. Before we merge this could you please add a test with those arguments omitted from the config so that we can verify that this works as expected?

@sinc59
Copy link
Contributor Author

sinc59 commented Mar 2, 2022

Thanks for this @sinc59. Before we merge this could you please add a test with those arguments omitted from the config so that we can verify that this works as expected?

Hi @stephybun i have added null ressources to validate the changes. I've only change the "options" test argument to validate null value (on options) and "nameservers" list to validate if not empty.

This is ok ?

@sinc59 sinc59 requested a review from stephybun March 3, 2022 09:29
Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

LGTM 💯 thanks @sinc59!

@stephybun stephybun merged commit 55ceaa0 into hashicorp:main Mar 3, 2022
@github-actions github-actions bot added this to the v2.99.0 milestone Mar 3, 2022
stephybun added a commit that referenced this pull request Mar 3, 2022
@github-actions
Copy link

This functionality has been released in v2.99.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants