Skip to content

Commit ee88277

Browse files
authored
ACR: Parse 'ModuleList' from ACR server metadata to populate 'Dependencies' in PSResourceInfo object (#1604)
1 parent 8730b58 commit ee88277

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/code/PSResourceInfo.cs

+10
Original file line numberDiff line numberDiff line change
@@ -969,6 +969,16 @@ public static bool TryConvertFromContainerRegistryJson(
969969
{
970970
metadata["Dependencies"] = ParseContainerRegistryDependencies(requiredModulesElement, out errorMsg).ToArray();
971971
}
972+
if (string.Equals(packageName, "Az", StringComparison.OrdinalIgnoreCase) || packageName.StartsWith("Az.", StringComparison.OrdinalIgnoreCase))
973+
{
974+
if (rootDom.TryGetProperty("PrivateData", out JsonElement privateDataElement) && privateDataElement.TryGetProperty("PSData", out JsonElement psDataElement))
975+
{
976+
if (psDataElement.TryGetProperty("ModuleList", out JsonElement moduleListDepsElement))
977+
{
978+
metadata["Dependencies"] = ParseContainerRegistryDependencies(moduleListDepsElement, out errorMsg).ToArray();
979+
}
980+
}
981+
}
972982

973983
var additionalMetadataHashtable = new Dictionary<string, string>
974984
{

0 commit comments

Comments
 (0)