pulumi/pkg/engine/lifecycletest/testdata/output/TestRetainOnDelete
Will Jones b4ee9680a0
Display `[retain]` in all cases of delete retention (#16506)
When the `RetainOnDelete` resource option is set, the console should
display `[retain]` next to resources which are being deleted from the
Pulumi program to indicate that, while the Pulumi state for those
resources will be deleted, the provider will not be instructed to
actually `Delete` the resource (effectively leaving the resource
unmanaged).

Currently, Pulumi decides whether or not to add the `[retain]` text by
inspecting resource state attached to a display step. However, there are
two places in which a display step is constructed:

* As part of normal/"in-memory" execution, whereby resource state is
inherently available and attached to the display step.
* As part of deserializing an existing JSON event stream (e.g. from a
Pulumi REST API call), whereby resource state is _not_ available and so
absent (`nil`) from the display step. This is also the codepath taken by
display tests.

The absence of the state in the latter codepath means that `[retain]` is
not displayed. This needn't be the case however. The `RetainOnDelete`
option is explicitly persisted in our JSON events and copied on to the
display step, so we can just use that instead. This commit makes this
change. Additionally, the single test we have for `RetainOnDelete` is
pulled out into its own file and display testing is now enabled for that
test.
2024-06-28 23:19:26 +00:00
..
0 Display `[retain]` in all cases of delete retention (#16506) 2024-06-28 23:19:26 +00:00
1 Display `[retain]` in all cases of delete retention (#16506) 2024-06-28 23:19:26 +00:00
2 Display `[retain]` in all cases of delete retention (#16506) 2024-06-28 23:19:26 +00:00