k8s: Dashboard history: Fix created by (#99714)

This commit is contained in:
Stephanie Hingtgen
2025-01-28 18:53:12 -03:00
committed by GitHub
parent b4b49fc587
commit d7070d11f6
2 changed files with 49 additions and 2 deletions
@@ -283,6 +283,15 @@ func (s *Service) UnstructuredToLegacyDashboardVersion(ctx context.Context, item
return nil, err
}
// if updated by is set, then this version of the dashboard was "created"
// by that user
if obj.GetUpdatedBy() != "" {
updatedBy, err := s.k8sclient.GetUserFromMeta(ctx, obj.GetUpdatedBy())
if err == nil && updatedBy != nil {
createdBy = updatedBy
}
}
id, err := obj.GetResourceVersionInt64()
if err != nil {
return nil, err