|
|
@ -1,3 +1,5 @@ |
|
|
|
|
|
|
|
import { v4 as uuidv4 } from 'uuid'; |
|
|
|
|
|
|
|
|
|
|
|
import { AddQueryTemplateCommand, QueryTemplate } from '../types'; |
|
|
|
import { AddQueryTemplateCommand, QueryTemplate } from '../types'; |
|
|
|
|
|
|
|
|
|
|
|
import { API_VERSION, QueryTemplateKinds } from './query'; |
|
|
|
import { API_VERSION, QueryTemplateKinds } from './query'; |
|
|
@ -48,7 +50,11 @@ export const convertAddQueryTemplateCommandToDataQuerySpec = ( |
|
|
|
apiVersion: API_VERSION, |
|
|
|
apiVersion: API_VERSION, |
|
|
|
kind: QueryTemplateKinds.QueryTemplate, |
|
|
|
kind: QueryTemplateKinds.QueryTemplate, |
|
|
|
metadata: { |
|
|
|
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: { |
|
|
|
spec: { |
|
|
|
title: title, |
|
|
|
title: title, |
|
|
|