Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tfprotov5+tfprotov6: Support for Protocol Version 5.3 and 6.3 (#205)
Reference: #204
- Loading branch information
Showing
15 changed files
with
1,278 additions
and
995 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
```release-note:feature | ||
Added support for protocol version 5.3 and 6.3, which allows providers to opt into the `PlanResourceChange` RPC for resource destruction | ||
``` | ||
|
||
```release-note:enhancement | ||
tfprotov5: Added `ServerCapabilities` type and `ServerCapabilities` field to `GetProviderSchemaResponse` | ||
``` | ||
|
||
```release-note:enhancement | ||
tfprotov6: Added `ServerCapabilities` type and `ServerCapabilities` field to `GetProviderSchemaResponse` | ||
``` |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package toproto | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov5" | ||
"github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5" | ||
) | ||
|
||
func GetProviderSchema_ServerCapabilities(in *tfprotov5.ServerCapabilities) *tfplugin5.GetProviderSchema_ServerCapabilities { | ||
if in == nil { | ||
return nil | ||
} | ||
|
||
return &tfplugin5.GetProviderSchema_ServerCapabilities{ | ||
PlanDestroy: in.PlanDestroy, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package tfprotov5 | ||
|
||
// ServerCapabilities allows providers to communicate optionally supported | ||
// protocol features, such as forward-compatible Terraform behavior changes. | ||
// | ||
// This information is used in GetProviderSchemaResponse as capabilities are | ||
// static features which must be known upfront in the provider server. | ||
type ServerCapabilities struct { | ||
// PlanDestroy signals that a provider expects a call to | ||
// PlanResourceChange when a resource is going to be destroyed. This is | ||
// opt-in to prevent unexpected errors or panics since the | ||
// ProposedNewState in PlanResourceChangeRequest will be a null value. | ||
PlanDestroy bool | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.