[Fleet] make put component template idempotent for @custom and fleet global (#120819) (#120834)

Co-authored-by: Nicolas Chaulet <nicolas.chaulet@elastic.co>
This commit is contained in:
Kibana Machine 2021-12-08 16:42:07 -05:00 committed by GitHub
parent 0e7dccef43
commit b3b613a1d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -291,7 +291,6 @@ async function installDataStreamComponentTemplates(params: {
});
const templateNames = Object.keys(templates);
const templateEntries = Object.entries(templates);
// TODO: Check return values for errors
await Promise.all(
templateEntries.map(async ([name, body]) => {
@ -307,7 +306,6 @@ async function installDataStreamComponentTemplates(params: {
const { clusterPromise } = putComponentTemplate(esClient, logger, {
body,
name,
create: true,
});
return clusterPromise;
}
@ -343,7 +341,6 @@ export async function ensureDefaultComponentTemplate(
await putComponentTemplate(esClient, logger, {
name: FLEET_GLOBAL_COMPONENT_TEMPLATE_NAME,
body: FLEET_GLOBAL_COMPONENT_TEMPLATE_CONTENT,
create: true,
});
}