pulumi/pkg/engine
Sean Gillespie bea1bea93f
Load specific provider versions if requested (#2648)
* Load specific provider versions if requested

As part of pulumi/pulumi#2389, we need the ability for language hosts to
tell the engine that a particular resource registration, read, or invoke
needs to use a particular version of a resource provider. This was not
previously possible before; the engine prior to this commit loaded
plugins from a default provider map, which was inferred for every
resource provider based on the contents of a user's package.json, and
was itself prone to bugs.

This PR adds the engine support needed for language hosts to request a
particular version of a provider. If this occurs, the source evaluator
specifically records the intent to load a provider with a given version
and produces a "default" provider registration that requests exactly
that version. This allows the source evaluator to produce multiple
default providers for a signle package, which was previously not
possible.

This is accomplished by having the source evaluator deal in the
"ProviderRequest" type, which is a tuple of version and package. A
request to load a provider whose version matches the package of a
previously loaded provider will re-use the existing default provider. If
the version was not previously loaded, a new default provider is
injected.

* CR Feedback: raise error if semver is invalid

* CR: call String() if you want a hash key

* Update pkg/resource/deploy/providers/provider.go

Co-Authored-By: swgillespie <sean@pulumi.com>
2019-04-17 11:25:02 -07:00
..
destroy.go Use result.Result in more places. (#2568) 2019-03-19 16:21:50 -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 Filter diff keys based on provider info (#2526) 2019-03-06 16:41:19 -08:00
eventsink.go Make a smattering of CLI UX improvements 2018-09-24 08:43:46 -07:00
lifecycle_test.go Load specific provider versions if requested (#2648) 2019-04-17 11:25:02 -07:00
plan.go Use result.Result in more places. (#2568) 2019-03-19 16:21:50 -07:00
plugins.go Load default providers deterministically (#2590) 2019-03-26 13:29:34 -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
refresh.go Use result.Result in more places. (#2568) 2019-03-19 16:21:50 -07:00
snapshot.go Add license headers 2018-05-22 15:02:47 -07:00
update.go Load default providers deterministically (#2590) 2019-03-26 13:29:34 -07:00