mirror of https://github.com/pulumi/pulumi.git
ec1e3dded1
Resources can depend on others in a number of ways -- provider references, parent-child relationships, dependencies and property dependencies, and deleted-with relationships. With all these linkages to keep track of, it's easy for one to be missed and bugs to be introduced, and indeed this has happened on numerous occasions. This commit attempts to make it harder to introduce bugs where dependencies are missed by adding a new `GetAllDependencies` method to `resource.State`. The idea is not that this will make all traversals of dependencies shorter and neater (though in many cases it does), but that it will force iterations over a resource's dependency set to account for all possible relations appropriately, and discard any that are not important explicitly. > [!NOTE] > In some cases the use of `GetAllDependencies` means that algorithms > which previously mutated an existing set of properties are > easier/cleaner to express by building up a new set of dependencies and > mutating after the loop's completion. This does mean a change of > performance characteristics in some places but I don't think these are > significant and for the most part they are off hot paths -- `state move` > and `state rename` are the most obvious examples. Fixes #16746 |
||
---|---|---|
.. | ||
dependency_graph.go | ||
dependency_graph_rapid_test.go | ||
dependency_graph_test.go | ||
doc.go |