From 244516cec2ca1a9748a63e2ff28c089ebaebe4e5 Mon Sep 17 00:00:00 2001 From: Roberto Jimenez Sanchez Date: Tue, 2 Dec 2025 19:36:25 +0100 Subject: [PATCH] fix(provisioning): ensure versionClients map is shared across dashboard export calls - Store versionClients map returned from createDashboardConversionShim - The map is captured in the shim closure and shared across all dashboard conversion calls - This ensures client caching works correctly when exporting multiple dashboards --- pkg/registry/apis/provisioning/jobs/export/resources.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apis/provisioning/jobs/export/resources.go b/pkg/registry/apis/provisioning/jobs/export/resources.go index d68d1f6b3be..32508d4b488 100644 --- a/pkg/registry/apis/provisioning/jobs/export/resources.go +++ b/pkg/registry/apis/provisioning/jobs/export/resources.go @@ -138,7 +138,9 @@ func ExportSpecificResources(ctx context.Context, options provisioning.ExportJob } // Create a shared dashboard conversion shim and cache for all dashboard resources + // The versionClients map will be shared across all dashboard conversion calls var dashboardShim conversionShim + var versionClients map[string]dynamic.ResourceInterface for _, resourceRef := range options.Resources { result := jobs.JobResourceResult{ @@ -233,8 +235,9 @@ func ExportSpecificResources(ctx context.Context, options provisioning.ExportJob // Handle dashboard version conversion using the shared shim logic if gvr.GroupResource() == resources.DashboardResource.GroupResource() { // Create or reuse the dashboard shim (shared across all dashboard resources) + // The versionClients map is shared across all calls to preserve client caching if dashboardShim == nil { - dashboardShim, _ = createDashboardConversionShim(ctx, clients, gvr) + dashboardShim, versionClients = createDashboardConversionShim(ctx, clients, gvr) } item, err = dashboardShim(ctx, item)