docs/plugin-protocol: Add notes about missing configuration in ReadResource and UpgradeResourceState request messages (#31998)

This opts to inline document these intentional design decisions in the protocol definition as a catch-all for it not being documented elsewhere.

Protocol Buffers files updated via:

```shell
make protobuf
```
This commit is contained in:
Brian Flad 2022-10-13 16:29:34 -04:00 committed by GitHub
parent 980bf430f3
commit 8c93420270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 0 deletions

View File

@ -183,6 +183,15 @@ message PrepareProviderConfig {
}
message UpgradeResourceState {
// Request is the message that is sent to the provider during the
// UpgradeResourceState RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to exist (in the case of resource destruction), be wholly
// known, nor match the given prior state, which could lead to unexpected
// provider behaviors for practitioners.
message Request {
string type_name = 1;
@ -240,6 +249,14 @@ message Configure {
}
message ReadResource {
// Request is the message that is sent to the provider during the
// ReadResource RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to be wholly known nor match the given prior state, which
// could lead to unexpected provider behaviors for practitioners.
message Request {
string type_name = 1;
DynamicValue current_state = 2;

View File

@ -201,6 +201,15 @@ message ValidateProviderConfig {
}
message UpgradeResourceState {
// Request is the message that is sent to the provider during the
// UpgradeResourceState RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to exist (in the case of resource destruction), be wholly
// known, nor match the given prior state, which could lead to unexpected
// provider behaviors for practitioners.
message Request {
string type_name = 1;
@ -258,6 +267,14 @@ message ConfigureProvider {
}
message ReadResource {
// Request is the message that is sent to the provider during the
// ReadResource RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to be wholly known nor match the given prior state, which
// could lead to unexpected provider behaviors for practitioners.
message Request {
string type_name = 1;
DynamicValue current_state = 2;

View File

@ -1800,6 +1800,15 @@ func (x *PrepareProviderConfig_Response) GetDiagnostics() []*Diagnostic {
return nil
}
// Request is the message that is sent to the provider during the
// UpgradeResourceState RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to exist (in the case of resource destruction), be wholly
// known, nor match the given prior state, which could lead to unexpected
// provider behaviors for practitioners.
type UpgradeResourceState_Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -2236,6 +2245,14 @@ func (x *Configure_Response) GetDiagnostics() []*Diagnostic {
return nil
}
// Request is the message that is sent to the provider during the
// ReadResource RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to be wholly known nor match the given prior state, which
// could lead to unexpected provider behaviors for practitioners.
type ReadResource_Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache

View File

@ -1819,6 +1819,15 @@ func (x *ValidateProviderConfig_Response) GetDiagnostics() []*Diagnostic {
return nil
}
// Request is the message that is sent to the provider during the
// UpgradeResourceState RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to exist (in the case of resource destruction), be wholly
// known, nor match the given prior state, which could lead to unexpected
// provider behaviors for practitioners.
type UpgradeResourceState_Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -2255,6 +2264,14 @@ func (x *ConfigureProvider_Response) GetDiagnostics() []*Diagnostic {
return nil
}
// Request is the message that is sent to the provider during the
// ReadResource RPC.
//
// This message intentionally does not include configuration data as any
// configuration-based or configuration-conditional changes should occur
// during the PlanResourceChange RPC. Additionally, the configuration is
// not guaranteed to be wholly known nor match the given prior state, which
// could lead to unexpected provider behaviors for practitioners.
type ReadResource_Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache