-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
google_compute_router: dynamic block leads to undesired diff in plan #9353
Comments
Hi @edwardmedia, should |
@aderuelle yes. I think so. |
Hm, yeah that should probably be a set in the schema. You should be able to fix your diff by using |
@slevenick and @edwardmedia re-ordering the items on our side doesn't work since we are using a dynamic block. Is there any update on fixing this or can I just make a PR myself to https://github.com/hashicorp/terraform-provider-google/blob/master/google/resource_compute_router.go#L110 changing |
Changing from Changing from a List to a Set in the schema is possible, but may be considered a breaking change as it breaks interpolation on the field |
We use it from within a module and given the way that we pass around/transform the relevant variable, a list is not working for us. I'm a bit confused why fixing the schema would be considered a breaking change. Related to hashicorp/terraform#28803 I've seen a bunch of other providers/resources make this exact list to set schema change without issues or having to declare it a breaking change. |
We technically consider it a breaking change because it can break user configs that interpolate based on the current ordering of the List field. Changing to a set changes the order which will cause diffs for anyone using interpolation on that field. That said, it is definitely something that we would consider doing. It would likely involve changing the behavior in |
Yeah this is a huge pain, I even tried to sort the list myself but since edit: here is a way to make it sortable by join(".",[ for x in split(".", "10.116.192.0/19") : format("%03d", replace(x, "/^(\\d{1,3})/\\d{1,2}$/", "$1")) ])
|
* KMS_config_first_commit * kmscommit for author change * Updated label to KeyValueLabels * kmsconfig_update_key_ring_crypto_key_name * Fixed issues in resource_netapp_kmsconfig_test.go * removed roation_period * changed location to us-west1 * fixed double quotes * changes_with_labels * changed location to us-central1 [upstream:08644b8fb4c5d63b13c11283a068f1e132903637] Signed-off-by: Modular Magician <[email protected]>
* KMS_config_first_commit * kmscommit for author change * Updated label to KeyValueLabels * kmsconfig_update_key_ring_crypto_key_name * Fixed issues in resource_netapp_kmsconfig_test.go * removed roation_period * changed location to us-west1 * fixed double quotes * changes_with_labels * changed location to us-central1 [upstream:08644b8fb4c5d63b13c11283a068f1e132903637] Signed-off-by: Modular Magician <[email protected]>
This issue is going to be addressed in the short term by GoogleCloudPlatform/magic-modules#10572, and in the long term by making the field a Set (GoogleCloudPlatform/magic-modules#10118 (comment)). I'll mark this issue as something for v6.0 |
… by config order (hashicorp#10572) Co-authored-by: Luca Prete <[email protected]> Co-authored-by: Sarah French <[email protected]> [upstream:43a016f81c954557aeaad7f4f8286774f294e70e] Signed-off-by: Modular Magician <[email protected]>
…g order (#10572) (#18228) [upstream:43a016f81c954557aeaad7f4f8286774f294e70e] Signed-off-by: Modular Magician <[email protected]>
This should be fixed now. Should we close it @SarahFrench ? |
I left the issue open so it reminds the team to make the long-term fix of changing the field to a Set as part of the 6.0.0 release - I'll double check that's still the plan and close this issue if that's not the case Edit: we're ok to change to a Set as the reordering added in GoogleCloudPlatform/magic-modules#10572 solves the problem for end users but means that some testing tools aren't as usable, such as ImportStateVerify. |
sgtm @SarahFrench FYI I opened another PR with the fix as per your comment. Worst case we can use that one in the major release. |
Thanks! I left a note on that PR about needing to remove the list reordering added in GoogleCloudPlatform/magic-modules#10572 but I'll otherwise leave review to the assigned reviewer |
This PR, GoogleCloudPlatform/magic-modules#10572 seems to have caused constant drift, every apply Terraform tried to re-order order advertised_ip_ranges properties according to the order in config |
Hi @philip-harvey ! This is definitely bad and undesired. Can you please open a bug for this and let me know there how to reproduce it? I'm surprised our tests didn't get this.. |
Hej @philip-harvey Did you already open a bug for this? |
Can you please open a bug here
<https://github.com/hashicorp/terraform-provider-google/issues> and put a
configuration to replicate the issue?
Thanks!
Il giorno lun 17 giu 2024 alle ore 16:04 Tim Klicks <
***@***.***> ha scritto:
… Hej @philip-harvey <https://github.com/philip-harvey>
Did you already open a bug for this?
If not, I can also do it as I have a working config which shows the
permadiff.
@LucaPrete <https://github.com/LucaPrete> What do you need from my side,
if the bug is not yet opened?
—
Reply to this email directly, view it on GitHub
<#9353 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AARY7UDLZJIRCYWRLEHEVLTZH3UHJAVCNFSM46QW3X5KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMJXGM2DQNRYGYYA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@LucaPrete |
Same kind of unexpected behaviour for |
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.Terraform Version
Affected Resource(s)
Terraform Configuration Files
Original configuration with individual
advertised_ip_ranges
blocksUpdate configuration with single
dynamic advertised_ip_ranges
blockDebug Output
N/A
Panic Output
N/A
Expected Behavior
No change to plan
Actual Behavior
Plan shows resource modification should apply
Steps to Reproduce
advertised_ip_ranges
blocks to a singledynamic
block in thegoogle_compute_router
resourceterraform apply
Important Factoids
set
doesn't helpReferences
N/A
b/318814729
The text was updated successfully, but these errors were encountered: