mirror of https://github.com/pulumi/pulumi.git
b4ee9680a0
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. |
||
---|---|---|
.. | ||
diff.stderr.txt | ||
diff.stdout.txt | ||
eventstream.json | ||
progress.stderr.txt | ||
progress.stdout.txt |