From 58631213ca2cc1c1880ff08e3511232b4b9e1908 Mon Sep 17 00:00:00 2001 From: magodo Date: Thu, 18 May 2023 18:29:03 +0800 Subject: [PATCH] Ignore armschema resoruce types that have trailing slash --- azlist/azlist.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/azlist/azlist.go b/azlist/azlist.go index e2f8c47..7944d85 100644 --- a/azlist/azlist.go +++ b/azlist/azlist.go @@ -237,6 +237,17 @@ func BuildARMSchemaTree(armSchemaFile []byte) (ARMSchemaTree, error) { } } + var deleteRts []string + // Remove resource types that has trailing slash, e.g. "Microsoft.Network/publicIPAddresses/" + for rt := range armSchemas { + if strings.HasSuffix(rt, "/") { + deleteRts = append(deleteRts, rt) + } + } + for _, rt := range deleteRts { + delete(armSchemas, rt) + } + remains := len(armSchemas) for remains > 0 {