From a81c28b1533e76c400f7c650f01101e24832af05 Mon Sep 17 00:00:00 2001 From: Bruno Abrantes Date: Wed, 30 Jul 2025 10:37:10 +0200 Subject: [PATCH] chore: include stackId when marking a dashboard as rejected during migration (#108887) Signed-off-by: Bruno Abrantes --- pkg/registry/apis/dashboard/legacy/migrate.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/registry/apis/dashboard/legacy/migrate.go b/pkg/registry/apis/dashboard/legacy/migrate.go index bb938f7e532..3da3a01aab8 100644 --- a/pkg/registry/apis/dashboard/legacy/migrate.go +++ b/pkg/registry/apis/dashboard/legacy/migrate.go @@ -32,8 +32,9 @@ type MigrateOptions struct { LargeObjects apistore.LargeObjectSupport BlobStore resourcepb.BlobStoreClient Resources []schema.GroupResource - WithHistory bool // only applies to dashboards - OnlyCount bool // just count the values + WithHistory bool // only applies to dashboards + OnlyCount bool // just count the values + StackID string // stack identifier for logging Progress func(count int, msg string) } @@ -135,6 +136,7 @@ func (a *dashboardSqlAccess) Migrate(ctx context.Context, opts MigrateOptions) ( // Now run each migration blobStore := BlobStoreInfo{} + opts.StackID = fmt.Sprintf("%d", info.StackID) // Pass stack ID through options a.log.Info("start migrating legacy resources", "namespace", opts.Namespace, "orgId", info.OrgID, "stackId", info.StackID) for _, m := range migratorFuncs { blobs, err := m(ctx, info.OrgID, opts, stream) @@ -310,6 +312,7 @@ func (a *dashboardSqlAccess) migrateDashboards(ctx context.Context, orgId int64, "dashboard", row.Dash.Name, "uid", row.Dash.UID, "id", id, + "stackId", opts.StackID, "namespace", opts.Namespace, ) opts.Progress(-2, fmt.Sprintf("rejected: id:%s, uid:%s", id, row.Dash.Name))