pulumi/pkg/resource/deploy
Thomas Gummerer 898a682ef6
Make sure non-targeted resources are not updated (#15476)
When the `--target` option is used, resources that already exist in the
snapshot, but aren't directly targeted should not be updated at all.
Internally in the engine, this is done by turning them into a
`SameStep`, meaning no updates will actually be preformed, and we will
make it look like the resource stayed the same.

However, we currently still write the "new" state of the resource (e.g.
updated dependencies, inputs, etc.) into the snapshot. This is mostly
fine as long as the new dependencies already exist. If a dependency on a
resource is that doesn't already exist is added however this breaks.
Since the resource that's being depended on doesn't exist in the
snapshot and isn't targeted, we won't create it. At the same time we're
adding a dependency on that virtually non-existing resource, which makes
the snapshot invalid.

Since we're in `--target` mode, we should do what we promised the user,
and only update the targeted resources, nothing else. Introduce a new
`NonTargetedSameStep` here, which does exactly that. It's essentially
the same as a `SameStep`, but we always use the *old* state instead of
the new one when writing it out. Since the resource is not targeted,
this leaves it in the same state as before.

Fixes #12096
Fixes #15382
2024-03-05 07:49:11 +00:00
..
deploytest Engine support for remote transforms (#15290) 2024-02-21 16:30:46 +00:00
providers [conformance tests] Fix run root and use program info everywhere (#15191) 2024-01-25 23:28:58 +00:00
builtins.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
builtins_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
deployment.go Check qualified type for root stackness (#14714) 2023-12-04 10:36:51 +00:00
deployment_executor.go Fix handling of delete failures for targeted destroys (#14735) 2023-12-05 17:19:10 +00:00
deployment_executor_test.go Fix handling of delete failures for targeted destroys (#14735) 2023-12-05 17:19:10 +00:00
deployment_test.go Allow anything in resource names (#14107) 2023-11-20 08:59:00 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
import_test.go Fix stack name validation check (#15245) 2024-01-27 10:35:20 +00:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
manifest_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
plan.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
plan_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
snapshot.go Verify partial journals in engine tests (#15018) 2024-01-05 23:16:40 +00:00
snapshot_test.go all: Fix revive issues 2023-03-21 08:55:11 -07:00
source.go Split CallRequest into ResourceCallRequest (#15404) 2024-02-08 13:16:23 +00:00
source_error.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_error_test.go [ci] `pkg/resource/deploy/source_error.go` coverage (#14982) 2023-12-22 20:57:52 +00:00
source_eval.go Engine support for remote transforms (#15290) 2024-02-21 16:30:46 +00:00
source_eval_test.go Engine support for remote transforms (#15290) 2024-02-21 16:30:46 +00:00
source_null.go Change Source.Iterate to return an error (#13996) 2023-09-20 14:34:24 +00:00
source_query.go Split CallRequest into ResourceCallRequest (#15404) 2024-02-08 13:16:23 +00:00
source_query_test.go Ensure project plugins are absolute paths (#15470) 2024-02-22 11:43:18 +00:00
state_builder.go Fix duplicate resource error from failed delete operations (#14042) 2023-09-26 15:18:35 +00:00
state_builder_test.go When changing parents also fix URNs (#13935) 2023-09-14 19:52:27 +00:00
step.go Make sure non-targeted resources are not updated (#15476) 2024-03-05 07:49:11 +00:00
step_executor.go Don't update new state outputs for replace steps (#15112) 2024-01-09 21:21:13 +00:00
step_executor_test.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
step_generator.go Make sure non-targeted resources are not updated (#15476) 2024-03-05 07:49:11 +00:00
step_generator_test.go Fix stack name validation check (#15245) 2024-01-27 10:35:20 +00:00
step_test.go [ci] `pkg/resource/deploy/(step(_generator|_executor)?|import).go` coverage (#14997) 2023-12-22 21:14:04 +00:00
target.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
target_test.go [ci] `pkg/resource/deploy/target.go` coverage (#14981) 2023-12-22 20:57:21 +00:00