diff --git a/pkg/registry/apis/provisioning/jobs/sync/worker.go b/pkg/registry/apis/provisioning/jobs/sync/worker.go index 170fe9cd833..5d51f1f1e67 100644 --- a/pkg/registry/apis/provisioning/jobs/sync/worker.go +++ b/pkg/registry/apis/provisioning/jobs/sync/worker.go @@ -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) } diff --git a/pkg/registry/apis/provisioning/resources/folders.go b/pkg/registry/apis/provisioning/resources/folders.go index d519e30273c..9574f097956 100644 --- a/pkg/registry/apis/provisioning/resources/folders.go +++ b/pkg/registry/apis/provisioning/resources/folders.go @@ -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 == "./" {