Skip to content

Commit 3029d93

Browse files
tas50claude
andcommitted
🐛 Fix JsonToDict input and error handling in Azure providers
- functions.go: serialize site.Properties instead of entire Site object - frontdoor.go: propagate JsonToDict errors for health probe/load balancing settings - dns.go: propagate JsonToDict errors for record set properties Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 43d1da5 commit 3029d93

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

providers/azure/resources/dns.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (a *mqlAzureSubscriptionDnsServiceZone) recordSets() ([]any, error) {
150150

151151
properties, err := convert.JsonToDict(rs.Properties)
152152
if err != nil {
153-
properties = nil
153+
return nil, err
154154
}
155155

156156
var ttl int64

providers/azure/resources/frontdoor.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,15 @@ func (a *mqlAzureSubscriptionFrontDoorServiceProfile) originGroups() ([]any, err
284284
if og.Properties.ProvisioningState != nil {
285285
provisioningState = string(*og.Properties.ProvisioningState)
286286
}
287-
healthProbeSettings, _ = convert.JsonToDict(og.Properties.HealthProbeSettings)
288-
loadBalancingSettings, _ = convert.JsonToDict(og.Properties.LoadBalancingSettings)
287+
var err error
288+
healthProbeSettings, err = convert.JsonToDict(og.Properties.HealthProbeSettings)
289+
if err != nil {
290+
return nil, err
291+
}
292+
loadBalancingSettings, err = convert.JsonToDict(og.Properties.LoadBalancingSettings)
293+
if err != nil {
294+
return nil, err
295+
}
289296
}
290297

291298
mqlOg, err := CreateResource(a.MqlRuntime, "azure.subscription.frontDoorService.profile.originGroup", map[string]*llx.RawData{

providers/azure/resources/functions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func (a *mqlAzureSubscriptionFunctionsService) functionApps() ([]any, error) {
7272
continue
7373
}
7474

75-
properties, err := convert.JsonToDict(site)
75+
properties, err := convert.JsonToDict(site.Properties)
7676
if err != nil {
7777
return nil, err
7878
}

0 commit comments

Comments
 (0)