Skip to content

Commit 95576c8

Browse files
committed
remove ListResource call in ValidateListResourceConfig
1 parent 5438a9e commit 95576c8

File tree

2 files changed

+2
-36
lines changed

2 files changed

+2
-36
lines changed

internal/fwserver/server_listresource.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ package fwserver
55

66
import (
77
"context"
8-
"github.com/hashicorp/terraform-plugin-framework/resource"
9-
"github.com/hashicorp/terraform-plugin-go/tftypes"
108
"iter"
119

1210
"github.com/hashicorp/terraform-plugin-framework/diag"
1311
"github.com/hashicorp/terraform-plugin-framework/internal/fwschema"
1412
"github.com/hashicorp/terraform-plugin-framework/internal/logging"
1513
"github.com/hashicorp/terraform-plugin-framework/list"
14+
"github.com/hashicorp/terraform-plugin-framework/resource"
1615
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
16+
"github.com/hashicorp/terraform-plugin-go/tftypes"
1717
)
1818

1919
// ListRequest is the framework server request for the ListResource RPC.

internal/proto5server/server_validatelistresourceconfig.go

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,6 @@ func (s *Server) ValidateListResourceConfig(ctx context.Context, proto5Req *tfpr
3434
return toproto5.ValidateListResourceConfigResponse(ctx, fwResp), nil
3535
}
3636

37-
config, diags := fromproto5.Config(ctx, proto5Req.Config, listResourceSchema)
38-
39-
fwResp.Diagnostics.Append(diags...)
40-
41-
if diags.HasError() {
42-
return toproto5.ValidateListResourceConfigResponse(ctx, fwResp), nil
43-
}
44-
45-
resourceSchema, diags := s.FrameworkServer.ResourceSchema(ctx, proto5Req.TypeName)
46-
47-
fwResp.Diagnostics.Append(diags...)
48-
49-
if diags.HasError() {
50-
return toproto5.ValidateListResourceConfigResponse(ctx, fwResp), nil
51-
}
52-
53-
identitySchema, diags := s.FrameworkServer.ResourceIdentitySchema(ctx, proto5Req.TypeName)
54-
55-
fwResp.Diagnostics.Append(diags...)
56-
57-
if diags.HasError() {
58-
return toproto5.ValidateListResourceConfigResponse(ctx, fwResp), nil
59-
}
60-
61-
req := &fwserver.ListRequest{
62-
Config: config,
63-
ListResource: listResource,
64-
ResourceSchema: resourceSchema,
65-
ResourceIdentitySchema: identitySchema,
66-
}
67-
stream := &fwserver.ListResultsStream{}
68-
69-
s.FrameworkServer.ListResource(ctx, req, stream)
70-
7137
fwReq, diags := fromproto5.ValidateListResourceConfigRequest(ctx, proto5Req, listResource, listResourceSchema)
7238

7339
fwResp.Diagnostics.Append(diags...)

0 commit comments

Comments
 (0)