-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Anton Tayanovskyy <[email protected]> | ||
Date: Thu, 21 Dec 2023 13:05:17 -0600 | ||
Subject: [PATCH 37/37] Do not cache large schemas | ||
|
||
|
||
diff --git a/shim/shim.go b/shim/shim.go | ||
index 9ef51a5245..b94f722d26 100644 | ||
--- a/shim/shim.go | ||
+++ b/shim/shim.go | ||
@@ -3,7 +3,6 @@ package shim | ||
import ( | ||
"context" | ||
"fmt" | ||
- "sync" | ||
|
||
pfprovider "github.com/hashicorp/terraform-plugin-framework/provider" | ||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" | ||
@@ -57,13 +56,8 @@ func markTagsAllNotComputedForResource(rn string, r *schema.Resource) *schema.Re | ||
u := *r | ||
if r.SchemaFunc != nil { | ||
old := r.SchemaFunc | ||
- var once sync.Once | ||
- var cache map[string]*schema.Schema | ||
u.SchemaFunc = func() map[string]*schema.Schema { | ||
- once.Do(func() { | ||
- cache = markTagsAllNotComputedForSchema(rn, old()) | ||
- }) | ||
- return cache | ||
+ return markTagsAllNotComputedForSchema(rn, old()) | ||
} | ||
} else { | ||
u.Schema = markTagsAllNotComputedForSchema(rn, r.Schema) |