pulumi/pkg/resource
Pat Gavlin 28579eba94
Rework asset identity and exposure of old assets. (#548)
Note: for the purposes of this discussion, archives will be treated as
assets, as their differences are not particularly meaningful.

Currently, the identity of an asset is derived from the hash and the
location of its contents (i.e. two assets are equal iff their contents
have the same hash and the same path/URI/inline value). This means that
changing the source of an asset will cause the engine to detect a
difference in the asset even if the source's contents are identical. At
best, this leads to inefficiencies such as unnecessary updates. This
commit changes asset identity so that it is derived solely from an
asset's hash. The source of an asset's contents is no longer part of
the asset's identity, and need only be provided if the contents
themselves may need to be available (e.g. if a hash does not yet exist
for the asset or if the asset's contents might be needed for an update).

This commit also changes the way old assets are exposed to providers.
Currently, an old asset is exposed as both its hash and its contents.
This allows providers to take a dependency on the contents of an old
asset being available, even though this is not an invariant of the
system. These changes remove the contents of old assets from their
serialized form when they are passed to providers, eliminating the
ability of a provider to take such a dependency. In combination with the
changes to asset identity, this allows a provider to detect changes to
an asset simply by comparing its old and new hashes.

This is half of the fix for [pulumi/pulumi-cloud#158]. The other half
involves changes in [pulumi/pulumi-terraform].
2017-11-12 11:45:13 -08:00
..
config Encrypt secrets in Pulumi.yaml 2017-10-24 16:48:12 -07:00
deploy Initial work on tracing support (#521) 2017-11-08 17:08:51 -08:00
idl Bring LUMIDL up to code 2017-09-11 16:58:25 -07:00
plugin Rework asset identity and exposure of old assets. (#548) 2017-11-12 11:45:13 -08:00
provider Initial work on tracing support (#521) 2017-11-08 17:08:51 -08:00
stack Fix where integration tests look for checkpoints 2017-10-27 19:42:17 -07:00
testdata Fix asset bugs; write more tests 2017-10-24 09:00:11 -07:00
asset.go Rework asset identity and exposure of old assets. (#548) 2017-11-12 11:45:13 -08:00
asset_test.go Rework asset identity and exposure of old assets. (#548) 2017-11-12 11:45:13 -08:00
errors.go Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00
properties.go Add more context information to assert. (#449) 2017-10-24 08:25:39 -07:00
properties_diff.go Add diffing logic for assets/archives 2017-07-17 12:11:15 -07:00
properties_diff_test.go Rework asset identity and exposure of old assets. (#548) 2017-11-12 11:45:13 -08:00
properties_test.go Tolerate computed and output properties 2017-08-03 11:01:38 -07:00
resource_goal.go Add auto-parenting 2017-10-15 04:38:26 -07:00
resource_id.go Encrypt secrets in Pulumi.yaml 2017-10-24 16:48:12 -07:00
resource_id_test.go Permit -1 for randlen and maxlen 2017-07-15 09:59:44 -07:00
resource_state.go Track resources that are pending deletion in checkpoints. 2017-10-18 17:09:00 -07:00
status.go Wire up Lumi to the new runtime strategy 2017-09-04 11:35:21 -07:00
urn.go Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00
urn_test.go Rename pulumi-fabric to pulumi 2017-09-21 19:18:21 -07:00