File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ FEATURES:
6
6
ENHANCEMENTS:
7
7
8
8
BUG FIXES:
9
+ - Fix a bug that provider crashes when loading azure schema.
9
10
10
11
## v1.6.0
11
12
FEATURES:
Original file line number Diff line number Diff line change 7
7
"log"
8
8
"sort"
9
9
"strings"
10
+ "sync"
10
11
11
12
"github.com/Azure/terraform-provider-azapi/internal/azure/types"
12
13
)
@@ -16,7 +17,11 @@ var schema *Schema
16
17
//go:embed generated
17
18
var StaticFiles embed.FS
18
19
20
+ var mutex = & sync.Mutex {}
21
+
19
22
func GetAzureSchema () * Schema {
23
+ mutex .Lock ()
24
+ defer mutex .Unlock ()
20
25
if schema == nil {
21
26
data , err := StaticFiles .ReadFile ("generated/index.json" )
22
27
if err != nil {
Original file line number Diff line number Diff line change 6
6
"log"
7
7
"os"
8
8
"strings"
9
- "sync"
10
9
11
10
"github.com/Azure/azure-sdk-for-go/sdk/azcore"
12
11
"github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud"
@@ -308,10 +307,7 @@ func providerConfigure(p *schema.Provider) schema.ConfigureContextFunc {
308
307
}
309
308
310
309
// load schema
311
- var mutex sync.Mutex
312
- mutex .Lock ()
313
310
azure .GetAzureSchema ()
314
- mutex .Unlock ()
315
311
return client , nil
316
312
}
317
313
}
You can’t perform that action at this time.
0 commit comments