mirror of
https://github.com/hashicorp/terraform.git
synced 2026-04-21 14:18:43 -04:00
Because we treat dependency edges as reversed when a component instance is being destroyed, the final result (an object representing output values) for a component instance being destroyed must not depend on anything else in the evaluation graph, or else we'd cause a promise self-reference as the downstream component tries to configure itself based on our outputs. As a special case then, for a component instance being destroyed we take the planned output values directly from the plan, relying on the fact that the plan phase sets them to the prior state output values in that case, and therefore the result for such a component is available immediately without blocking on any other expression evaluation during the apply phase. This combines with several previous commits to create a first pass at handling ordering correctly when planning and applying a full destroy. This commit also incorporates some fixes and improvements to stackeval's apply-time testing helpers, which had some quirks and bugs when first added in a recent commit. One of those problems also revealed that the raw state loader was not resilient to a buggy caller setting a state entry to nil instead of removing it altogether, and that mistake seems relatively easy to make (as I did here in the test helper) so we'll tolerate it to make it possible to recover if such a bug does end up occurring in real code too. |
||
|---|---|---|
| .. | ||
| hooks | ||
| internal/stackeval | ||
| testdata/mainbundle | ||
| apply.go | ||
| doc.go | ||
| eval_expr.go | ||
| helper_test.go | ||
| hooks.go | ||
| plan.go | ||
| plan_test.go | ||
| telemetry.go | ||
| telemetry_test.go | ||
| validate.go | ||
| validate_test.go | ||