Skip to content

Commit f86f169

Browse files
authored
echoprovider: Fix bug where Terraform v1.12.1 would return an error indicating GetResourceIdentitySchemas was not implemented (#512)
* implement resource identity schema + changelogs * update plugin-testing * revert plugin-go
1 parent 549959b commit f86f169

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
kind: BUG FIXES
2+
body: 'echoprovider: Fixed bug where Terraform v1.12+ would return an error message indicating the provider doesn''t support `GetResourceIdentitySchemas`.'
3+
time: 2025-05-21T15:26:57.058404-04:00
4+
custom:
5+
Issue: "512"

echoprovider/server.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,3 +406,19 @@ func (e *echoProviderServer) CloseEphemeralResource(ctx context.Context, req *tf
406406
func (e *echoProviderServer) ValidateEphemeralResourceConfig(ctx context.Context, req *tfprotov6.ValidateEphemeralResourceConfigRequest) (*tfprotov6.ValidateEphemeralResourceConfigResponse, error) {
407407
return &tfprotov6.ValidateEphemeralResourceConfigResponse{}, nil
408408
}
409+
410+
func (e *echoProviderServer) GetResourceIdentitySchemas(context.Context, *tfprotov6.GetResourceIdentitySchemasRequest) (*tfprotov6.GetResourceIdentitySchemasResponse, error) {
411+
return &tfprotov6.GetResourceIdentitySchemasResponse{}, nil
412+
}
413+
414+
func (e *echoProviderServer) UpgradeResourceIdentity(context.Context, *tfprotov6.UpgradeResourceIdentityRequest) (*tfprotov6.UpgradeResourceIdentityResponse, error) {
415+
return &tfprotov6.UpgradeResourceIdentityResponse{
416+
Diagnostics: []*tfprotov6.Diagnostic{
417+
{
418+
Severity: tfprotov6.DiagnosticSeverityError,
419+
Summary: "Unsupported UpgradeResourceIdentity Operation",
420+
Detail: "Resource Identity is not supported by this provider.",
421+
},
422+
},
423+
}, nil
424+
}

internal/testing/testsdk/providerserver/providerserver_protov5.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,11 @@ func (s Protov5ProviderServer) CloseEphemeralResource(ctx context.Context, req *
134134
func (s Protov5ProviderServer) ValidateEphemeralResourceConfig(ctx context.Context, req *tfprotov5.ValidateEphemeralResourceConfigRequest) (*tfprotov5.ValidateEphemeralResourceConfigResponse, error) {
135135
return &tfprotov5.ValidateEphemeralResourceConfigResponse{}, nil
136136
}
137+
138+
func (s Protov5ProviderServer) GetResourceIdentitySchemas(context.Context, *tfprotov5.GetResourceIdentitySchemasRequest) (*tfprotov5.GetResourceIdentitySchemasResponse, error) {
139+
return &tfprotov5.GetResourceIdentitySchemasResponse{}, nil
140+
}
141+
142+
func (s Protov5ProviderServer) UpgradeResourceIdentity(context.Context, *tfprotov5.UpgradeResourceIdentityRequest) (*tfprotov5.UpgradeResourceIdentityResponse, error) {
143+
return &tfprotov5.UpgradeResourceIdentityResponse{}, nil
144+
}

0 commit comments

Comments
 (0)