K8s: Fix dashboard history list timestamps (#102580)

This commit is contained in:
Stephanie Hingtgen
2025-03-21 09:19:33 +02:00
committed by GitHub
parent da95ee22cc
commit 996ff7d65e
2 changed files with 17 additions and 4 deletions
@@ -308,6 +308,10 @@ func (s *Service) UnstructuredToLegacyDashboardVersion(ctx context.Context, item
createdBy = updatedBy
}
}
created := obj.GetCreationTimestamp().Time
if updated, err := obj.GetUpdatedTimestamp(); err == nil && updated != nil {
created = *updated
}
id, err := obj.GetResourceVersionInt64()
if err != nil {
@@ -323,7 +327,7 @@ func (s *Service) UnstructuredToLegacyDashboardVersion(ctx context.Context, item
ID: id,
DashboardID: obj.GetDeprecatedInternalID(), // nolint:staticcheck
DashboardUID: uid,
Created: obj.GetCreationTimestamp().Time,
Created: created,
CreatedBy: createdBy.ID,
Message: obj.GetMessage(),
RestoredFrom: restoreVer,