-
Notifications
You must be signed in to change notification settings - Fork 99
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 Keep as much as possible traffic targets and liveness tests declarati… #404
DXE-2430 Keep as much as possible traffic targets and liveness tests declarati… #404
Conversation
3d6df40
to
a0c0867
Compare
If we focus for example only on traffic targets: the way elements not found in state were appended was problematic since iteration was done over a map having datacenters ids as keys, and since a golang range operation over those items was forcing sorting by datacenter id asc. |
Hello @hightoxicity, Thank you for your contribution. We will need some time to review these changes. Best regards, |
@hightoxicity , the config-gtm-api does not rely or expect a sort order of lists that it receives from clients. Hence my question, what issue you are seeing our trying to fix with this PR? |
After having imported things living in akamai with terraform import, if I run a terraform plan, it triggers changes since input vars does not match the sorting forced in the terraform state file by the provider. Behaviour expected here is the ability to produce terraform input vars with a sorting that matches the one that is done on akamai backend and that we see when we query directly the Akamai API:
The issue I have without this PR is that things are sorting in the middle (into the state) with a logic that neither honor inputs ordering provided nor the one of entities stored at akamai side. So I got a bunch of modifications just having terraform import things and trying to get a neutral tf plan at first terraform run. That provider (and more particularly the GTM code) does not allow us to get idempotency we expect when we do not start from scratch and have to deal with terraform import. |
Hello @hightoxicity, In order to review the PR, we have to reproduce the issue first. Could You please share the configuration files and steps You took that resulted in the issue You are describing? Also, please provide the version of akamai terraform provider You are using. Any information about remote state attributes You are importing would be helpful (without sensitive information, for example number of geomap assignments) Currently, there is a diff suppress functionality for traffic targets and geomap assignments order, but there is no such functionality for liveness tests. The order of those elements does not matter from the API perspective, hence changes in the local configuration have no impact on the result. With regards, |
Reproduction steps consists in:
We expect no update after having imported things living in GTM |
Thank you for providing implementation for the fix. May I ask to attach unit tests for those changes, please? |
I have also observed the forced re-ordering of targets because of the use of an ordered data structure to store them in state when in fact GTM targets do not have an order. |
Hi @hightoxicity , thank you for your PR, but we added our fix for this problem. Please check lates version of the provider. |
…on order
Try much as possible to preserve order of: