QueryLibrary: Don't use description when generating name (#94236)

This commit is contained in:
Haris Rozajac
2024-10-03 16:24:39 -06:00
committed by GitHub
parent a4d919c157
commit 2ea662854a

View File

@@ -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,