Remote provisioning: use client discovery for sync job (#102885)

* Use client discovery for folders and dashboards synchronization

* Remove unused dashboards client

* Add folders import again
This commit is contained in:
Roberto Jiménez Sánchez
2025-03-27 11:07:06 +01:00
committed by GitHub
parent e216c2f29d
commit b2d9b3abe6
2 changed files with 11 additions and 21 deletions
@@ -93,6 +93,9 @@ func (c *ResourceClients) ForKind(gvk schema.GroupVersionKind) (dynamic.Resource
return info.client, info.gvr, nil
}
// ForResource returns a client for a resource.
// If the resource has a version, it will be used.
// If the resource does not have a version, the preferred version will be used.
func (c *ResourceClients) ForResource(gvr schema.GroupVersionResource) (dynamic.ResourceInterface, schema.GroupVersionKind, error) {
c.mutex.Lock()
defer c.mutex.Unlock()