Skip to content

states/statefile: consistently sort resources across modules#25498

Merged
mildwonkey merged 1 commit intomasterfrom
mildwonkey/state-sort
Aug 11, 2020
Merged

states/statefile: consistently sort resources across modules#25498
mildwonkey merged 1 commit intomasterfrom
mildwonkey/state-sort

Conversation

@mildwonkey
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown

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