mirror of https://github.com/pulumi/pulumi.git
f5b117505c
This change updates the engine to detect if a `RegisterResource` request is coming from an older Node.js SDK that is using incorrect alias specs and, if so, transforms the aliases to be correct. This allows us to maintain compatibility for users who have upgraded their CLI but are still using an older version of the Node.js SDK with incorrect alias specs. We detect if the request is from a Node.js SDK by looking at the gRPC request's metadata headers, specifically looking at the "pulumi-runtime" and "user-agent" headers. First, if the request has a "pulumi-runtime" header with a value of "nodejs", we know it's coming from the Node.js plugin. The Node.js language plugin proxies gRPC calls from the Node.js SDK to the resource monitor and the proxy now sets the "pulumi-runtime" header to "nodejs" for `RegisterResource` calls. Second, if the request has a "user-agent" header that starts with "grpc-node-js/", we know it's coming from the Node.js SDK. This is the case for inline programs in the automation API, which connects directly to the resource monitor, rather than going through the language plugin's proxy. We can't just look at "user-agent", because in the proxy case it will have a Go-specific "user-agent". Updated Node.js SDKs set a new `aliasSpecs` field on the `RegisterResource` request, which indicates that the alias specs are correct, and no transforms are needed. |
||
---|---|---|
.. | ||
build-container | ||
google/protobuf | ||
pulumi | ||
.checksum.txt | ||
generate.sh | ||
grpc_version.txt |