-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure apply nodes are GraphNodeDestroyerCBD
If an instance was forced to be CreateBeforeDestroy due to a dependent, and that dependent had no changes to apply, the dependent would not be in the graph to force the CBD status on the change, and the result would be lost from the state. This rarely made any difference, because the status would be restored during the next plan. However if the resource was immediately removed from the configuration, the incorrect state would be the only source of the destroy order, which could result in a cycle during the next apply. While it would be better to use the destroy order calculated during plan, when there is a newly created object its plan state is not stored because the instance has a null state value. This means we still need to recompute the CBD status again during apply until a new way to transfer the information from plan to apply is developed. While instances without changes are not present in the apply graph, their resource expansion nodes do happen to be there and hold the configuration (and while they were previously an implementation quirk of the expansion system, they now play an important role in the ephemeral resource evaluation). Those resource expansion nodes didn't implement the `GraphNodeDestroyerCBD` interface though, which was why the CBD status was not picked up during apply. The fix is relatively easy, move the `GraphNodeDestroyerCBD` implementation down to the abstract resource node, to make sure all resources nodes implement the behavior. The nodes which need a different implementation already have it, and thus will override the embedded methods.
- Loading branch information
Showing
5 changed files
with
109 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters