Skip to content

Commit b116780

Browse files
committed
more storytelling
1 parent 79943d5 commit b116780

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/proto5server/server_listresource_tfprotov5_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,17 @@ func diagnosticResult(format string, args ...any) tfprotov5.ListResourceResult {
4040

4141
}
4242
func listFunc(ctx context.Context, req list.ListRequest, stream *list.ListResultsStream) {
43+
44+
// This likely gets refactored info as an "adapter" / "mux" concern.
4345
sdkResource, ok := SDKResourceFromContext(ctx)
4446
if !ok {
4547
return
4648
}
4749

50+
// This is different. We've added `stream.Proto5Results` so the provider
51+
// can generate plugin-go values instead of Framework values. Framework
52+
// performs no further processing on these values -- it only returns them
53+
// to plugin-go.
4854
stream.Proto5Results = func(push func(tfprotov5.ListResourceResult) bool) {
4955
// From the resource type, we can obtain an initialized ResourceData value
5056
d := sdkResource.Data(&terraformsdk.InstanceState{ID: "#groot"})

0 commit comments

Comments
 (0)