Add Handshake
to the provider protocol
#17819
Open
+2,057
−1,093
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #16876
The pulumi provider protocol gRPC always starts by calling CheckConfig and then Configure. The problem is that CheckConfig accepts a property bag, which could contain secrets or outputs or resource references, etc. However, the engine doesn't know if the provider supports these items (and vice versa) until Configure is called, since Configure is the call where the engine and the provider agree on which parts of the protocol they support.
This introduces a Handshake component to the provider protocol that establishes which version of the protocol the provider and engine support. This also adds the plugins root and program directories to that handshake request allowing a provider to know where it was started up from. This also replaces
Provider.Attach
as the handshake request includes the engine address to connect to.Tasting notes:
Handshake
with request/response to the protocol.Handshake
starts as a high watermark for accepts secrets, accepts resources, etc but includes the plugins root and program directories (if possible), as well as the engine address. This pretty much replaces the need forAttach
.dialPlugin
(where the engine establishes gRPC connections to plugins) to take a callback that is used to initialise the connectiontestConnection
, which captures the logic we have today -- call a dummy gRPC method and observed not implemented error to confirm connection is livehandshake
, which sends aHandshake
and captures the responseConfigure
, which a. happens later and b. is asynchronousprotocol
; moveacceptSecrets
and company fromconfigSource
to thereHandshake
is implemented, populateprotocol
ondialPlugin
. If not, fallback to populating inConfigure
Configure
impliesprotocol