diff --git a/patches/0037-Do-not-cache-large-schemas.patch b/patches/0037-Do-not-cache-large-schemas.patch new file mode 100644 index 00000000000..6d95804e9e3 --- /dev/null +++ b/patches/0037-Do-not-cache-large-schemas.patch @@ -0,0 +1,33 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Anton Tayanovskyy +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)