Skip to content

Commit

Permalink
fix start plugin method to be sync (elastic#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenIdo authored and orouz committed Jan 13, 2022
1 parent c3755de commit 17597c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export const createFindingsIndexTemplate = async (
esClient,
CSP_KUBEBEAT_INDEX_NAME,
CSP_KUBEBEAT_INDEX_PATTERN,
// TODO: check why this cast is required
findingsIndexMapping as Record<string, MappingProperty>
);
} catch (err) {
Expand Down
10 changes: 3 additions & 7 deletions x-pack/plugins/cloud_security_posture/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ export class CspPlugin implements Plugin<CspSetup, CspStart, CspPluginSetup, Csp
return {};
}

public async start(core: CoreStart) {
public start(core: CoreStart) {
this.logger.debug('csp: Started');
try {
createFindingsIndexTemplate(core.elasticsearch.client.asInternalUser);
} catch (e) {
return {};
}
createFindingsIndexTemplate(core.elasticsearch.client.asInternalUser).catch(this.logger.error);
return {};
}

public stop() {}
}

0 comments on commit 17597c1

Please sign in to comment.