Skip to content

Commit

Permalink
create dataview only if non exists (elastic#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
orouz authored Jan 24, 2022
1 parent c06ac0e commit 6ec9af2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions x-pack/plugins/cloud_security_posture/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ async function registerKubebeatDataView(
) {
try {
const [, depsStart] = await core.getStartServices();
const dataView = await depsStart.data.dataViews.find(CSP_KUBEBEAT_INDEX_NAME);
if (dataView) return;

await depsStart.data.dataViews.createAndSave({
title: CSP_KUBEBEAT_INDEX_NAME,
allowNoIndex: true,
Expand Down

0 comments on commit 6ec9af2

Please sign in to comment.