pulumi/pkg
Joe Duffy 0a38bc295c
Fix issue with --target deletion dependent calculation (#8360)
* Fix issue with --target deletion dependant calculation

The code that computed --target deletion dependants was not correct.
It used parent/child component relationships, but did not respect actual
DAG dependencies. As a result, it could erroneously leave hanging
references to resources that no longer exist after performing a
`pulumi destroy --target X` operation. This manifested in bugs like
https://github.com/pulumi/pulumi/issues/6283, which is fixed by this
change. The solution is to compute the (transitive!) dependency graph
correctly, factoring in both parent/child, as well as explicit and
implicit, dependencies. The existing logic does the correct thing once
we do this. I've also added tests for this area, including regression
tests that cover transitive dependency relationships, as well as ones
that would cause an infinite loop given a naive implementation.

* Add a changelog entry

* Fix failing test to include all destroyed targets

Unless I'm missing something, the entire tree should be deleted
in this test case because A is the ancestor for the entire tree.

* Use DependencyGraph to compute dependents

Per code review feedback from @pgavlin.

Co-authored-by: Anton Tayanovskyy <anton@pulumi.com>
2021-11-12 10:02:51 -05:00
..
backend [cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07:00
cmd/pulumi [cli] Emit JSON events for updates via --json flag (#8275) 2021-10-26 16:21:27 -07:00
codegen [schema] Add IsOverlay option to disable codegen for particular types (#8338) 2021-11-11 17:00:03 -07:00
engine Fix issue with --target deletion dependent calculation (#8360) 2021-11-12 10:02:51 -05:00
graph [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
operations [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
resource Fix issue with --target deletion dependent calculation (#8360) 2021-11-12 10:02:51 -05:00
secrets [cli] Prevent regression in loading passphrase secrets provider from state (#6976) 2021-05-06 14:40:44 +01:00
testing/integration Fix linting 2021-11-09 15:41:28 -08:00
util [breaking] Changing the version of go.mod in sdk / pkg to be v3 2021-04-14 19:32:18 +01:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
go.mod Update pkg -> sdk dependency for 3.17.1 (#8391) 2021-11-09 16:54:45 -05:00
go.sum Fix cmdutil.PrintTable to handle ansi escapes and non-byte glyphs (#8344) 2021-11-04 10:06:20 +00:00