pulumi/pkg/engine/lifecycletest
Fraser Waters 49d8298e84
Fix snapshot integrity on pending replacement (#17146)
This fixes a snapshot integrity issue with delete before replace, failed
creates, and multiple updates.

This was caused by https://github.com/pulumi/pulumi/pull/16510 where we
started removing pending replace resources as part of their replacement
steps. A well intentioned fix to stop trying to delete resources we'd
already deleted in a previous update.

The bug would manifest if the following happened:
1. An update goes to replace a resource with `deleteBeforeCreate` set.
It deletes the old resource (and saves the state as pending replace) but
then failed to create the new replacement resource.
2. A second update is run to try and create the replacement resource. At
this point the bug manifest and we delete the pending replace resource
from state, but then if the new resource fails to create again we end up
with an invalid snapshot.

The fix is very simple. If a resource is already pending replacement we
just don't issue a delete/remove step at all. The pending replace
resource will get cleaned up at the end by the create step creating the
new version.

Fixes #17111
Fixes #17073
Fixes #17070
Fixes #17069
Fixes #16916
2024-09-04 10:52:43 +00:00
..
testdata Fix snapshot integrity on pending replacement (#17146) 2024-09-04 10:52:43 +00:00
alias_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +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 Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
delete_before_replace_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
golang_sdk_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
import_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
loader_test.go Use cached loader in RPC codegen functions (#17126) 2024-09-01 05:12:16 +00:00
parameterized_test.go Ensure internal provider state doesn't clash with user config (#16837) 2024-07-30 12:22:32 +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 Fix snapshot integrity on pending replacement (#17146) 2024-09-04 10:52:43 +00:00
provider_test.go Ensure internal provider state doesn't clash with user config (#16837) 2024-07-30 12:22:32 +00:00
pulumi_test.go create unknowns when the provider is not known during construct (#16868) 2024-08-19 07:47:31 +00:00
refresh_legacy_diff_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
refresh_test.go Use int32 in Go interfaces that map to protobufs using int32 (#17068) 2024-08-28 13:45:17 +00:00
resource_reference_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
retain_on_delete_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
source_query_test.go Add parameterized `Call` support to the engine (#16813) 2024-07-26 15:36:53 +00:00
step_generator_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
target_test.go Propagate deleted parents of untargeted resources (#17117) 2024-08-30 14:31:50 +00:00
test_plan.go Support PULUMI_SHOW_COPILOT_LINK to enable 'explainFailure' link (#17109) 2024-08-29 20:43:29 +00:00
transformation_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
update_plan_test.go chore: fix some function names (#17128) 2024-09-03 08:57:30 +00:00