pulumi/pkg/resource/deploy
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
..
deploytest Rename 'package' to 'packageRef' (#16717) 2024-07-20 10:08:44 +00:00
providers Extend the TestReplacementParameterizedProvider test (#16644) 2024-07-15 08:33:36 +00:00
builtins.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
builtins_test.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
deployment.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
deployment_executor.go continue-on-error: fix integrity issues in up with changed dependencies (#16733) 2024-07-22 11:25:33 +00:00
deployment_executor_test.go Better handle property dependencies and `deletedWith` (#16088) 2024-05-03 17:08:06 +00:00
deployment_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go Extend the TestReplacementParameterizedProvider test (#16644) 2024-07-15 08:33:36 +00:00
import_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
manifest_test.go Refactor: move plugin kind to apitype (#15946) 2024-04-25 17:30:30 +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 Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
snapshot_test.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
source.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_error.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_error_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_eval.go Rename 'package' to 'packageRef' (#16717) 2024-07-20 10:08:44 +00:00
source_eval_test.go Extend the TestReplacementParameterizedProvider test (#16644) 2024-07-15 08:33:36 +00:00
source_null.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_query.go Initial work for parameterized providers (#16281) 2024-06-10 17:28:47 +00:00
source_query_test.go Query language runtime for options during “pulumi new” (#16346) 2024-06-17 17:10:55 +00:00
state_builder.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
state_builder_test.go When changing parents also fix URNs (#13935) 2023-09-14 19:52:27 +00:00
step.go Don't set `PendingReplacement` until `Delete` succeeds (#16699) 2024-07-18 12:27:06 +00:00
step_executor.go Remove `Step.Apply`'s `preview` parameter (#16367) 2024-06-14 10:19:13 +00:00
step_executor_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
step_generator.go Don't re-delete resources that are `PendingReplacement` (#16510) 2024-06-28 23:16:20 +00:00
step_generator_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
step_test.go Remove `Step.Apply`'s `preview` parameter (#16367) 2024-06-14 10:19:13 +00:00
target.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
target_test.go upgrade to latest version of golangci-lint (#15977) 2024-04-19 06:20:33 +00:00