Fixes refresh of resources with unchanged assets #1671
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1595, pulumi/pulumi-aws#3548
Before this change, refreshing an unchanged resource which used an Asset or an Archive resulted in polluting Pulumi state with a machine-local filename.
The simplest example this is tested on is:
After this change this example refreshes correctly with no changes detected.
Unfortunately this change by itself is insufficient to guarantee that these resources refresh correctly when Pulumi-tracked state is out of date with respect to the cloud state, and further work is required to make this correct for individual resources in each provider. For the example above, the upstream provider for BucketObject does not implement fetching contents of the object upon Read into a temporary file. Therefore refreshing the object in this situation updates the "etag" property but does not guide the user to the need of reconciling the FileAsset with the updated cloud state.