fixed folder issue

This commit is contained in:
Ryan McKinley
2025-03-11 11:23:49 +03:00
parent 229b549c23
commit f535d89efb
2 changed files with 6 additions and 0 deletions
@@ -483,6 +483,8 @@ func (r *syncJob) client(kind string) (dynamic.ResourceInterface, error) {
switch kind {
case dashboard.GROUP, dashboard.DASHBOARD_RESOURCE, "Dashboard":
return r.dashboards, nil
case folders.GROUP, folders.RESOURCE, "Folder":
return r.folders.Client(), nil
}
return nil, fmt.Errorf("unsupported resource: %s", kind)
}
@@ -30,6 +30,10 @@ func NewFolderManager(repo repository.Repository, client dynamic.ResourceInterfa
}
}
func (fm *FolderManager) Client() dynamic.ResourceInterface {
return fm.client
}
// EnsureFoldersExist creates the folder structure in the cluster.
func (fm *FolderManager) EnsureFolderPathExist(ctx context.Context, filePath string) (parent string, err error) {
if filePath == "" || filePath == "/" || filePath == "." || filePath == "./" {