From 64949f26e8f7edad3668bf1218b60df46badb159 Mon Sep 17 00:00:00 2001 From: Roberto Jimenez Sanchez Date: Tue, 2 Dec 2025 17:26:43 +0100 Subject: [PATCH] Fix folder path resolution for instance targets in WriteResourceFileFromObject Add fallback mechanism to handle folder resolution when rootFolder is empty (instance targets). First try DirPath with rootFolder, then fallback to DirPath without rootFolder if the first attempt fails. --- pkg/registry/apis/provisioning/resources/resources.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apis/provisioning/resources/resources.go b/pkg/registry/apis/provisioning/resources/resources.go index 42613c598ab..dff8ef4011c 100644 --- a/pkg/registry/apis/provisioning/resources/resources.go +++ b/pkg/registry/apis/provisioning/resources/resources.go @@ -183,7 +183,11 @@ func (r *ResourcesManager) WriteResourceFileFromObject(ctx context.Context, obj var ok bool fid, ok = r.folders.Tree().DirPath(folder, rootFolder) if !ok { - return "", fmt.Errorf("folder %s NOT found in tree with root: %s", folder, rootFolder) + // Fallback: try without rootFolder (for instance targets where rootFolder is empty) + fid, ok = r.folders.Tree().DirPath(folder, "") + if !ok { + return "", fmt.Errorf("folder %s NOT found in tree", folder) + } } }