pulumi/pkg/engine
Sean Gillespie 2870518a64 Refine resource replacement logic for providers (#2767)
This commit touches an intersection of a few different provider-oriented
features that combined to cause a particularly severe bug that made it
impossible for users to upgrade provider versions without seeing
replacements with their resources.

For some context, Pulumi models all providers as resources and places
them in the snapshot like any other resource. Every resource has a
reference to the provider that created it. If a Pulumi program does not
specify a particular provider to use when performing a resource
operation, the Pulumi engine injects one automatically; these are called
"default providers" and are the most common ways that users end up with
providers in their snapshot. Default providers can be identified by
their name, which is always prefixed with "default".

Recently, in an effort to make the Pulumi engine more flexible with
provider versions, it was made possible for the engine to have multiple
default providers active for a provider of a particular type, which was
previously not possible. Because a provider is identified as a tuple of
package name and version, it was difficult to find a name for these
duplicate default providers that did not cause additional problems. The
provider versioning PR gave these default providers a name that was
derived from the version of the package. This proved to be a problem,
because when users upgraded from one version of a package to another,
this changed the name of their default provider which in turn caused all
of their resources created using that provider (read: everything) to be
replaced.

To combat this, this PR introduces a rule that the engine will apply
when diffing a resource to determine whether or not it needs to be
replaced: "If a resource's provider changes, and both old and new
providers are default providers whose properties do not require
replacement, proceed as if there were no diff." This allows the engine
to gracefully recognize and recover when a resource's default provider changes
names, as long as the provider's config has not changed.
2019-06-03 12:16:31 -07:00
..
destroy.go Add --server to pulumi plugin install 2019-06-03 09:31:18 -07:00
diff.go Use Go Modules for dependency tracking 2019-04-10 08:37:51 +04:00
engine.go Add an API for importing stack outputs (#2180) 2018-11-14 13:33:35 -08:00
errors.go Show a better error message when decrypting fails (#1815) 2018-08-22 15:32:54 -07:00
events.go Track secrets inside the engine 2019-05-10 17:07:52 -07:00
eventsink.go Make a smattering of CLI UX improvements 2018-09-24 08:43:46 -07:00
lifecycle_test.go Refine resource replacement logic for providers (#2767) 2019-06-03 12:16:31 -07:00
plan.go Refine resource replacement logic for providers (#2767) 2019-06-03 12:16:31 -07:00
plugins.go Use server information from NodeJS host for fetching plugins 2019-06-03 09:31:18 -07:00
plugins_test.go Load default providers deterministically (#2590) 2019-03-26 13:29:34 -07:00
project.go Add license headers 2018-05-22 15:02:47 -07:00
query.go Add --server to pulumi plugin install 2019-06-03 09:31:18 -07:00
refresh.go Add --server to pulumi plugin install 2019-06-03 09:31:18 -07:00
snapshot.go Remove uses of plugins in the snapshot (#2662) 2019-04-23 09:53:44 -07:00
update.go Add --server to pulumi plugin install 2019-06-03 09:31:18 -07:00