pulumi/pkg/engine/lifecycletest
Thomas Gummerer 0febb7b096
continue-on-error: fix integrity issues in up with changed dependencies (#16733)
In `pulumi up --continue-on-error`, we have to make sure to not delete
resources that are still needed in the snapshot because an earlier step
failed. E.g. if B depends on A, and A fails to be deleted, we need to
make sure B is not deleted as well, otherwise we get a snapshot
integrity failure because B is missing A.

We do this by checking the dependencies of B in the *current program*,
e.g. only checking `dep.Res()`. However it is possible that the
dependencies in the new program are not the same.

For example, say resource A depends on provider B. Now we change the
program and resource A depends on provider C. We try to `pulumi up
--continue-on-error` the latter program, but the Update of resource A
fails. But because the new resource A only depends on C, and not on B,
we go ahead and delete B, resulting in a snapshot integrity failure,
because A has not been updated.

Fix this by also checking the `res.Old()` for dependencies, and not
deleting those either if `res` had a failure.

Note that this isn't an issue for creates/updates, because we only need
to check wheter a *new* resource is dependent on the existing resource.

Fixes https://github.com/pulumi/pulumi/issues/16720
2024-07-22 11:25:33 +00:00
..
testdata continue-on-error: fix integrity issues in up with changed dependencies (#16733) 2024-07-22 11:25:33 +00:00
alias_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
analyzer_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
continue_on_error_test.go continue-on-error: fix integrity issues in up with changed dependencies (#16733) 2024-07-22 11:25:33 +00:00
delete_before_replace_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
golang_sdk_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
import_test.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
parameterized_test.go Rename 'package' to 'packageRef' (#16717) 2024-07-20 10:08:44 +00:00
pending_delete_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
pending_replace_test.go Don't set `PendingReplacement` until `Delete` succeeds (#16699) 2024-07-18 12:27:06 +00:00
provider_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
pulumi_test.go Display `[retain]` in all cases of delete retention (#16506) 2024-06-28 23:19:26 +00:00
refresh_legacy_diff_test.go Change `pulumi refresh` to report diff relative to desired state instead of relative to only output changes (#16146) 2024-06-12 16:17:05 +00:00
refresh_test.go Don't call `Diff` when refreshing external resources (#16544) 2024-07-02 10:11:10 +00:00
resource_reference_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
retain_on_delete_test.go Display `[retain]` in all cases of delete retention (#16506) 2024-06-28 23:19:26 +00:00
source_query_test.go deploytest/RegisterResource: return struct instead of values (#15988) 2024-04-19 11:08:56 +00:00
step_generator_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00
target_test.go Propagate deleted dependencies of untargeted resources (#16247) 2024-05-23 12:31:03 +00:00
test_plan.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
transformation_test.go implement engine support for invoke transforms (#16559) 2024-07-11 16:01:44 +00:00
update_plan_test.go Add display to the engine tests (#16050) 2024-05-13 07:18:25 +00:00