Skip to content

Commit eb0198a

Browse files
authored
Satisfy provider protocol requirements for Terraform >= v1.21.1 (hashicorp#2733)
* Satisfy provider protocol requirements for Terraform >= v1.21.1 * Validate interface implementations for RawProviderServer. * Update Terraform versions used to check manifest examples with in CI
1 parent 4fec73e commit eb0198a

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

.changelog/2733.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
Fixes issue #2732 where the provider would fail when used with Terraform >= v1.12.1 due to missing `GetResourceIdentitySchemas` implementation.
3+
```

.github/workflows/check_examples.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ jobs:
2626
strategy:
2727
matrix:
2828
terraform_version:
29-
- "1.6.0"
30-
- "1.7.0"
31-
- "1.8.0"
32-
- "1.10.1"
33-
- "1.11.2"
29+
- "1.6.6"
30+
- "1.7.5"
31+
- "1.8.5"
32+
- "1.9.8"
33+
- "1.10.5"
34+
- "1.11.4"
35+
- "1.12.1"
3436
env:
3537
TF_X_KUBERNETES_MANIFEST_RESOURCE: 1
3638
TERM: linux
3739
steps:
38-
- uses: hashicorp/setup-terraform@a1502cd9e758c50496cc9ac5308c4843bcd56d36 # v3.0.0
40+
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
3941
with:
4042
terraform_version: ${{ matrix.terraform_version }}
4143
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ require (
1414
github.com/hashicorp/terraform-exec v0.23.0
1515
github.com/hashicorp/terraform-json v0.25.0
1616
github.com/hashicorp/terraform-plugin-docs v0.16.0
17-
github.com/hashicorp/terraform-plugin-framework v1.13.0
17+
github.com/hashicorp/terraform-plugin-framework v1.15.0
1818
github.com/hashicorp/terraform-plugin-go v0.27.0
1919
github.com/hashicorp/terraform-plugin-log v0.9.0
2020
github.com/hashicorp/terraform-plugin-mux v0.19.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ github.com/hashicorp/terraform-json v0.25.0 h1:rmNqc/CIfcWawGiwXmRuiXJKEiJu1ntGo
181181
github.com/hashicorp/terraform-json v0.25.0/go.mod h1:sMKS8fiRDX4rVlR6EJUMudg1WcanxCMoWwTLkgZP/vc=
182182
github.com/hashicorp/terraform-plugin-docs v0.16.0 h1:UmxFr3AScl6Wged84jndJIfFccGyBZn52KtMNsS12dI=
183183
github.com/hashicorp/terraform-plugin-docs v0.16.0/go.mod h1:M3ZrlKBJAbPMtNOPwHicGi1c+hZUh7/g0ifT/z7TVfA=
184-
github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw=
185-
github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU=
184+
github.com/hashicorp/terraform-plugin-framework v1.15.0 h1:LQ2rsOfmDLxcn5EeIwdXFtr03FVsNktbbBci8cOKdb4=
185+
github.com/hashicorp/terraform-plugin-framework v1.15.0/go.mod h1:hxrNI/GY32KPISpWqlCoTLM9JZsGH3CyYlir09bD/fI=
186186
github.com/hashicorp/terraform-plugin-go v0.27.0 h1:ujykws/fWIdsi6oTUT5Or4ukvEan4aN9lY+LOxVP8EE=
187187
github.com/hashicorp/terraform-plugin-go v0.27.0/go.mod h1:FDa2Bb3uumkTGSkTFpWSOwWJDwA7bf3vdP3ltLDTH6o=
188188
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=

manifest/provider/server.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ func init() {
2323
install.Install(scheme.Scheme)
2424
}
2525

26+
var _ tfprotov5.ProviderServer = &RawProviderServer{}
27+
var _ tfprotov5.ResourceServer = &RawProviderServer{}
28+
var _ tfprotov5.DataSourceServer = &RawProviderServer{}
29+
2630
// RawProviderServer implements the ProviderServer interface as exported from ProtoBuf.
2731
type RawProviderServer struct {
2832
// Since the provider is essentially a gRPC server, the execution flow is dictated by the order of the client (Terraform) request calls.
@@ -132,3 +136,15 @@ func (s *RawProviderServer) ValidateEphemeralResourceConfig(ctx context.Context,
132136
resp := &tfprotov5.ValidateEphemeralResourceConfigResponse{}
133137
return resp, nil
134138
}
139+
140+
func (s *RawProviderServer) GetResourceIdentitySchemas(ctx context.Context, req *tfprotov5.GetResourceIdentitySchemasRequest) (*tfprotov5.GetResourceIdentitySchemasResponse, error) {
141+
s.logger.Trace("[GetResourceIdentitySchemas][Request]\n%s\n", dump(*req))
142+
resp := &tfprotov5.GetResourceIdentitySchemasResponse{}
143+
return resp, nil
144+
}
145+
146+
func (s *RawProviderServer) UpgradeResourceIdentity(ctx context.Context, req *tfprotov5.UpgradeResourceIdentityRequest) (*tfprotov5.UpgradeResourceIdentityResponse, error) {
147+
s.logger.Trace("[UpgradeResourceIdentity][Request]\n%s\n", dump(*req))
148+
resp := &tfprotov5.UpgradeResourceIdentityResponse{}
149+
return resp, nil
150+
}

0 commit comments

Comments
 (0)