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

r/ecs_task_definition: Fix equivalency comparator #2339

Merged
merged 2 commits into from
Nov 17, 2017

Conversation

radeksimko
Copy link
Member

Closes #2336

@ziggythehamster @nathanielks @achille-roussel @bturbes - do you folks mind testing this with your configs and/or pasting it here so we can test it to make sure the bug doesn't re-appear?

Test results

TF_ACC=1 go test ./aws -v -run=TestAccAWSEcsTaskDefinition -timeout 120m
=== RUN   TestAccAWSEcsTaskDefinition_basic
--- PASS: TestAccAWSEcsTaskDefinition_basic (57.24s)
=== RUN   TestAccAWSEcsTaskDefinition_withScratchVolume
--- PASS: TestAccAWSEcsTaskDefinition_withScratchVolume (35.02s)
=== RUN   TestAccAWSEcsTaskDefinition_withEcsService
--- PASS: TestAccAWSEcsTaskDefinition_withEcsService (149.91s)
=== RUN   TestAccAWSEcsTaskDefinition_withTaskRoleArn
--- PASS: TestAccAWSEcsTaskDefinition_withTaskRoleArn (38.40s)
=== RUN   TestAccAWSEcsTaskDefinition_withNetworkMode
--- PASS: TestAccAWSEcsTaskDefinition_withNetworkMode (66.97s)
=== RUN   TestAccAWSEcsTaskDefinition_constraint
--- PASS: TestAccAWSEcsTaskDefinition_constraint (33.79s)
=== RUN   TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource
--- PASS: TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource (55.91s)
=== RUN   TestAccAWSEcsTaskDefinition_arrays
--- PASS: TestAccAWSEcsTaskDefinition_arrays (34.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	471.371s

@radeksimko radeksimko added the bug Addresses a defect in current functionality. label Nov 17, 2017
@radeksimko radeksimko added this to the v1.3.1 milestone Nov 17, 2017
@radeksimko radeksimko added the regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. label Nov 17, 2017
@ziggythehamster
Copy link
Contributor

I'm happy to test - how do I go about doing that?

@radeksimko
Copy link
Member Author

radeksimko commented Nov 17, 2017

@ziggythehamster Try cloning the repository and building the binary locally: https://github.com/terraform-providers/terraform-provider-aws#building-the-provider

then in the directory with your ECS configs just rm -rf ./.terraform && terraform init to load the new binary and carry on with terraform plan which should present no diff.

Eventually I can try and build it for your platform if you tell me more about your environment - i.e. architecture & OS.

Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

👍 one logging nit/suggestion

canonicalJson2, err := jsonutil.BuildJSON(obj2)
if err != nil {
return false, err
}

log.Printf("[DEBUG] Comparing canonical definitions,\nFirst: %s\nSecond: %s\n",
canonicalJson1, canonicalJson2)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: not sure if this is debugging that you left in unintentionally, however if intended, maybe we should log instead the result of the compare; logical match or difference etc. Right here we're just logging both and not actually saying if Terraform seems them as equal, that's left up to the user debugger

Copy link
Member Author

Choose a reason for hiding this comment

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

right, good point - I'm happy to add more context (i.e. whether it's a match).

The reason I left it there is because I had hard times comparing those JSONs in a failing test, where you can only get the original (non-canonical) JSONs which is also kind of intention, because this process should remain hidden as implementation detail.

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_ecs_task_definition: Regression from issue #1195 causing an endless cycle of diffs
3 participants