Skip to content

Commit 3156644

Browse files
tas50claude
andcommitted
🐛 Fix extension __id path and simplify commonPricingArgs nil guard
Use "/extension/" (singular) in buildExtensionResources to maintain backward compatibility with the pre-existing CSPM extension cache keys. Simplify the nil-props guard in commonPricingArgs by substituting an empty PricingProperties struct, so all nil-safe field checks handle it uniformly without duplicating zero-value assignments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 414ac57 commit 3156644

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

providers/azure/resources/cloud_defender.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,7 @@ func commonPricingArgs(props *security.PricingProperties, mqlResourceName, subId
6262
}
6363

6464
if props == nil {
65-
args["enabled"] = llx.BoolData(false)
66-
args["pricingTier"] = llx.StringData("")
67-
args["subPlan"] = llx.StringData("")
68-
args["enforce"] = llx.BoolData(false)
69-
args["deprecated"] = llx.BoolData(false)
70-
args["freeTrialRemainingTime"] = llx.StringData("")
71-
args["enablementTime"] = llx.TimeDataPtr(nil)
72-
args["inherited"] = llx.BoolData(false)
73-
args["inheritedFrom"] = llx.StringData("")
74-
args["replacedBy"] = llx.ArrayData([]any{}, types.String)
75-
args["resourcesCoverageStatus"] = llx.StringData("")
76-
return args
65+
props = &security.PricingProperties{}
7766
}
7867

7968
enabled := false
@@ -640,7 +629,7 @@ func buildExtensionResources(runtime *plugin.Runtime, extensions []*security.Ext
640629
}
641630

642631
extResource, err := CreateResource(runtime, mqlResourceName, map[string]*llx.RawData{
643-
"__id": llx.StringData(parentIdPrefix + "/extensions/" + name),
632+
"__id": llx.StringData(parentIdPrefix + "/extension/" + name),
644633
"name": llx.StringData(name),
645634
"isEnabled": llx.BoolData(isEnabled),
646635
"additionalProperties": llx.DictData(additionalProps),

0 commit comments

Comments
 (0)