From 63f45448b5fa1f467153719ee47016ff8779e217 Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Mon, 19 Feb 2024 16:42:35 +0100 Subject: [PATCH] load core schema last Signed-off-by: Ivan Milchev --- providers/extensible_schema.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/providers/extensible_schema.go b/providers/extensible_schema.go index 1eef9e306e..c3cbc04259 100644 --- a/providers/extensible_schema.go +++ b/providers/extensible_schema.go @@ -172,8 +172,16 @@ func (x *extensibleSchema) unsafeRefresh() { res := resources.Schema{ Resources: map[string]*resources.ResourceInfo{}, } - for _, schema := range x.loaded { - res.Add(schema) + + for id, schema := range x.loaded { + if id != BuiltinCoreID { + res.Add(schema) + } + } + + // Add the core schema last, so that it cannot be overridden by any other schema + if x.loaded[BuiltinCoreID] != nil { + res.Add(x.loaded[BuiltinCoreID]) } // Note: This object is read-only and thus must be re-created to