We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4aea754 + f1f1ebc commit 30277f4Copy full SHA for 30277f4
azure/scope/azure_secret_cloud.go
@@ -41,6 +41,8 @@ var (
41
globalHTTPClient *http.Client
42
// Mutex to protect concurrent access to global transport resources
43
globalTransportMutex sync.RWMutex
44
+ // Mutex to protect concurrent access to Azure environment map
45
+ azureEnvironmentMutex sync.Mutex
46
)
47
48
func init() {
@@ -131,7 +133,11 @@ func processAzureEnvironmentJSON(envJSON string) error {
131
133
return errors.Wrap(err, "failed to parse Azure environment JSON")
132
134
}
135
136
+ //Protect concurrent access to Azure environment map
137
+ azureEnvironmentMutex.Lock()
138
azure.SetEnvironment(env.Name, env)
139
+ azureEnvironmentMutex.Unlock()
140
+
141
fmt.Printf("CAPZ: Loaded Azure environment: %s\n", env.Name)
142
return nil
143
0 commit comments