From 2ea662854a23f378de7602a865d56ddb67f5512f Mon Sep 17 00:00:00 2001 From: Haris Rozajac <58232930+harisrozajac@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:24:39 -0600 Subject: [PATCH] QueryLibrary: Don't use description when generating name (#94236) --- public/app/features/query-library/api/mappers.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/app/features/query-library/api/mappers.ts b/public/app/features/query-library/api/mappers.ts index 6c0af6c8539..9dfb2fe4439 100644 --- a/public/app/features/query-library/api/mappers.ts +++ b/public/app/features/query-library/api/mappers.ts @@ -1,3 +1,5 @@ +import { v4 as uuidv4 } from 'uuid'; + import { AddQueryTemplateCommand, QueryTemplate } from '../types'; import { API_VERSION, QueryTemplateKinds } from './query'; @@ -48,7 +50,11 @@ export const convertAddQueryTemplateCommandToDataQuerySpec = ( apiVersion: API_VERSION, kind: QueryTemplateKinds.QueryTemplate, metadata: { - generateName: 'A' + title.replaceAll(' ', '-'), + /** + * Server will append to whatever is passed here, but just to be safe we generate a uuid + * More info https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#idempotency + */ + generateName: uuidv4(), }, spec: { title: title,