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

DXE-2430 Sort property traffic targets by DC id asc and sort liveness tests by… #401

Conversation

hightoxicity
Copy link

… name asc to ensure idempotency

Ensure better idempotency forcing sorting of :

  • traffic targets, sorting elements by target datacenter ids asc
  • liveness tests, sorting elements by liveness tests names asc

Thx for review

@Slonimskaia
Copy link
Contributor

Slonimskaia commented Mar 9, 2023

Hello @hightoxicity,

Thank you for your contribution. We will need some time to review these changes.

Best regards,
Tatiana

@Slonimskaia Slonimskaia changed the title Sort property traffic targets by DC id asc and sort liveness tests by… DXE-2430 Sort property traffic targets by DC id asc and sort liveness tests by… Mar 9, 2023
@Slonimskaia
Copy link
Contributor

@hightoxicity I see that with these changes a few unit tests fail. Please address them, before we proceed reviewing your pull request

@hightoxicity
Copy link
Author

@hightoxicity I see that with these changes a few unit tests fail. Please address them, before we proceed reviewing your pull request

Hi [Slonimskaia] yes I just saw it, I need more work on my 2 PRs, I will let you know when it is fixed+ready.

Thx

@hightoxicity
Copy link
Author

OK, I have figured out that some sorting operations are already done in more appropriate places (DiffSuppressFunc), and I have also understood that I have still modifications in the plan because this function is called on a per element basis for schema.TypeList and not as a whole. That is why if my property has same traffic targets at both sides but are declared in different order, it conduces in all cases the plan to have modifications. My current difficulty is that I have no predictable way to sort my inputs to match how it is sorted in akamai GTM (I am bulk importing properties) and I can not get an initial neutral terraform plan because of this.

DiffSuppressFunc+schema.TypeList behaviour is a known issue:
hashicorp/terraform-plugin-sdk#477

Maybe something can be done adding a DiffSuppressFunc on the parent resource (in the property resource) but not sure.

@hightoxicity
Copy link
Author

Closing it in favour of #404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants