pulumi/pkg/resource/deploy/providers
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
..
provider.go Load specific provider versions if requested (#2648) 2019-04-17 11:25:02 -07:00
provider_test.go Load specific provider versions if requested (#2648) 2019-04-17 11:25:02 -07:00
reference.go Install missing plugins on startup (#2560) 2019-03-15 15:01:37 -07:00
reference_test.go Adopt golangci-lint and address issues 2018-11-08 14:11:47 -08:00
registry.go Install missing plugins on startup (#2560) 2019-03-15 15:01:37 -07:00
registry_test.go Install missing plugins on startup (#2560) 2019-03-15 15:01:37 -07:00