pulumi/pkg/resource
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
..
config Don't fail on configuration keys like a:config:b:c 2018-11-20 14:14:37 -08:00
deploy Load specific provider versions if requested (#2648) 2019-04-17 11:25:02 -07:00
edit Add edit.RenameStack 2019-03-11 14:44:15 -07:00
graph Process deletions conservatively in parallel (#1963) 2018-09-27 15:49:08 -07:00
plugin Allows the nodejs launcher to recognize that certain types of errors were printed, ensuring we don't cascade less relevant messages. (#2554) 2019-03-20 11:54:32 -07:00
provider Implement status sinks 2018-08-31 15:56:53 -07:00
stack Follow up on #2369 (#2397) 2019-01-28 17:38:16 -08:00
testdata Fix asset bugs; write more tests 2017-10-24 09:00:11 -07:00
asset.go Correctly handle FileArchives when the filename contains a dot 2019-03-28 13:26:07 -07:00
asset_test.go Correctly handle FileArchives when the filename contains a dot 2019-03-28 13:26:07 -07:00
errors.go Add license headers 2018-05-22 15:02:47 -07:00
properties.go Add API types for the V3 checkpoint (#2384) 2019-01-23 13:33:25 -08:00
properties_diff.go Elide diffs in internal properties (#2543) 2019-03-11 18:01:48 -07:00
properties_diff_test.go Add license headers 2018-05-22 15:02:47 -07:00
properties_test.go Add license headers 2018-05-22 15:02:47 -07:00
resource_goal.go Add support for explicit delete-before-replace (#2415) 2019-01-31 14:27:53 -08:00
resource_id.go Add license headers 2018-05-22 15:02:47 -07:00
resource_id_test.go Adopt golangci-lint and address issues 2018-11-08 14:11:47 -08:00
resource_operation.go Add a list of in-flight operations to the deployment (#1759) 2018-08-10 21:39:59 -07:00
resource_state.go Implement more precise delete-before-replace semantics. (#2369) 2019-01-28 09:46:30 -08:00
stack.go Make a smattering of CLI UX improvements 2018-09-24 08:43:46 -07:00
status.go Partial status for resource providers 2018-07-02 13:32:23 -07:00
urn.go Add license headers 2018-05-22 15:02:47 -07:00
urn_test.go Add license headers 2018-05-22 15:02:47 -07:00