mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-23 07:33:32 -06:00
Marshal plan#relevant_attributes in deterministic order (#327)
Signed-off-by: Marcin Wyszynski <marcin.pixie@gmail.com>
This commit is contained in:
parent
c22a387167
commit
992b5d604a
@ -682,6 +682,13 @@ func (p *Plan) marshalRelevantAttrs(plan *plans.Plan) error {
|
||||
|
||||
p.RelevantAttributes = append(p.RelevantAttributes, ResourceAttr{addr, path})
|
||||
}
|
||||
|
||||
// We sort the relevant attributes by resource address to make the output
|
||||
// deterministic. Our own equivalence tests rely on it.
|
||||
sort.Slice(p.RelevantAttributes, func(i, j int) bool {
|
||||
return p.RelevantAttributes[i].Resource < p.RelevantAttributes[j].Resource
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -203,17 +203,17 @@
|
||||
}
|
||||
},
|
||||
"relevant_attributes": [
|
||||
{
|
||||
"attribute": [
|
||||
"id"
|
||||
],
|
||||
"resource": "module.create.random_integer.random"
|
||||
},
|
||||
{
|
||||
"attribute": [
|
||||
"string"
|
||||
],
|
||||
"resource": "data.tfcoremock_simple_resource.read"
|
||||
},
|
||||
{
|
||||
"attribute": [
|
||||
"id"
|
||||
],
|
||||
"resource": "module.create.random_integer.random"
|
||||
}
|
||||
],
|
||||
"resource_changes": [
|
||||
|
Loading…
Reference in New Issue
Block a user