Skip to content

Commit c10e995

Browse files
committed
Add context setup to proto{5,6}server ListResource()
1 parent 6af9164 commit c10e995

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

internal/proto5server/server_listresource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/hashicorp/terraform-plugin-framework/diag"
1010
"github.com/hashicorp/terraform-plugin-framework/internal/fromproto5"
1111
"github.com/hashicorp/terraform-plugin-framework/internal/fwserver"
12+
"github.com/hashicorp/terraform-plugin-framework/internal/logging"
1213
"github.com/hashicorp/terraform-plugin-framework/internal/toproto5"
1314
"github.com/hashicorp/terraform-plugin-framework/list"
1415
"github.com/hashicorp/terraform-plugin-go/tfprotov5"
@@ -27,6 +28,9 @@ func ListRequestErrorDiagnostics(ctx context.Context, diags ...diag.Diagnostic)
2728
}
2829

2930
func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov5.ListResourceRequest) (*tfprotov5.ListResourceServerStream, error) {
31+
ctx = s.registerContext(ctx)
32+
ctx = logging.InitContext(ctx)
33+
3034
protoStream := &tfprotov5.ListResourceServerStream{Results: tfprotov5.NoListResults}
3135
allDiags := diag.Diagnostics{}
3236

internal/proto6server/server_listresource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/hashicorp/terraform-plugin-framework/diag"
1010
"github.com/hashicorp/terraform-plugin-framework/internal/fromproto6"
1111
"github.com/hashicorp/terraform-plugin-framework/internal/fwserver"
12+
"github.com/hashicorp/terraform-plugin-framework/internal/logging"
1213
"github.com/hashicorp/terraform-plugin-framework/internal/toproto6"
1314
"github.com/hashicorp/terraform-plugin-framework/list"
1415
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
@@ -27,6 +28,9 @@ func ListRequestErrorDiagnostics(ctx context.Context, diags ...diag.Diagnostic)
2728
}
2829

2930
func (s *Server) ListResource(ctx context.Context, protoReq *tfprotov6.ListResourceRequest) (*tfprotov6.ListResourceServerStream, error) {
31+
ctx = s.registerContext(ctx)
32+
ctx = logging.InitContext(ctx)
33+
3034
protoStream := &tfprotov6.ListResourceServerStream{Results: tfprotov6.NoListResults}
3135
allDiags := diag.Diagnostics{}
3236

0 commit comments

Comments
 (0)