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

states/statefile: consistently sort resources across modules #25498

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

mildwonkey
Copy link
Contributor

If a statefile had resources with the same name in different modules,
the sort order could be inconsistent between state refreshes. This adds
the module to the Less() function used in sorting and a minimal test to
verify consistent ordering.

Fixes #21552

If a statefile had resources with the same name in different modules,
the sort order could be inconsistent between state refreshes. This adds
the module to the Less() function used in sorting and a minimal test to
verify consistent ordering.
@codecov
Copy link

codecov bot commented Jul 7, 2020

Codecov Report

Merging #25498 into master will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted Files Coverage Δ
states/statefile/version4.go 57.83% <100.00%> (-0.34%) ⬇️
dag/marshal.go 53.33% <0.00%> (-1.12%) ⬇️

@mildwonkey mildwonkey added this to the v0.13.1 milestone Jul 7, 2020
@mildwonkey mildwonkey merged commit 5964e92 into master Aug 11, 2020
genx7up pushed a commit to aweps/terraform that referenced this pull request Aug 14, 2020
…rp#25498)

If a statefile had resources with the same name in different modules,
the sort order could be inconsistent between state refreshes. This adds
the module to the Less() function used in sorting and a minimal test to
verify consistent ordering.
@mildwonkey mildwonkey deleted the mildwonkey/state-sort branch August 17, 2020 14:16
@ghost
Copy link

ghost commented Sep 11, 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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Sep 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

State snapshots have inconsistent ordering for resources differing only in module address
2 participants