Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution][Detection Engine] fixes 410 error on index legacy template call #164682

Merged
merged 32 commits into from
Aug 24, 2023
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
245ba57
add test element
vitaliidm May 5, 2023
c3d1806
Merge branch 'elastic:main' into main
vitaliidm May 5, 2023
cea3e3b
Revert "add test element"
vitaliidm May 5, 2023
8a240c5
Merge remote-tracking branch 'upstream/main'
vitaliidm May 10, 2023
d1b32ab
Merge branch 'elastic:main' into main
vitaliidm May 16, 2023
1b8bd2b
Merge branch 'elastic:main' into main
vitaliidm May 18, 2023
711fe3e
Merge remote-tracking branch 'upstream/main'
vitaliidm Jun 7, 2023
5272556
Merge branch 'main' of ssh://github.com/vitaliidm/kibana
vitaliidm Jun 7, 2023
9589ab4
Merge remote-tracking branch 'upstream/main'
vitaliidm Jun 9, 2023
fcd9618
Merge remote-tracking branch 'upstream/main'
vitaliidm Jun 30, 2023
5b12314
Merge remote-tracking branch 'upstream/main'
vitaliidm Jul 10, 2023
0b09ae1
Merge remote-tracking branch 'upstream/main'
vitaliidm Jul 17, 2023
82db206
Merge remote-tracking branch 'upstream/main'
vitaliidm Jul 25, 2023
d19ce2c
Merge remote-tracking branch 'upstream/main'
vitaliidm Jul 28, 2023
0870df1
Merge branch 'main' of https://github.com/vitaliidm/kibana
vitaliidm Jul 28, 2023
f298651
Merge remote-tracking branch 'upstream/main'
vitaliidm Jul 28, 2023
659f27b
Merge branch 'main' of ssh://github.com/vitaliidm/kibana
vitaliidm Jul 28, 2023
2fbc9a9
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 2, 2023
a6ab99c
Merge branch 'main' of https://github.com/vitaliidm/kibana
vitaliidm Aug 2, 2023
ef68911
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 3, 2023
5f9aedf
Merge branch 'elastic:main' into main
vitaliidm Aug 4, 2023
9e9300d
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 9, 2023
b76a432
Merge branch 'main' of https://github.com/vitaliidm/kibana
vitaliidm Aug 9, 2023
8dc6639
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 10, 2023
8c39b37
Merge branch 'main' of ssh://github.com/vitaliidm/kibana
vitaliidm Aug 10, 2023
2131970
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 16, 2023
4339475
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 17, 2023
a317ca5
Merge branch 'main' of ssh://github.com/vitaliidm/kibana
vitaliidm Aug 17, 2023
428957b
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 24, 2023
34a6643
Merge branch 'main' of ssh://github.com/vitaliidm/kibana
vitaliidm Aug 24, 2023
defe673
Merge remote-tracking branch 'upstream/main'
vitaliidm Aug 24, 2023
1b2377a
[Security Solution][Detection Engine] fixes 410 error on legayc templ…
vitaliidm Aug 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
import { ListClient } from '../../services/lists/list_client';

export const removeLegacyTemplatesIfExist = async (lists: ListClient): Promise<void> => {
const legacyTemplateExists = await lists.getLegacyListTemplateExists();
const legacyTemplateListItemsExists = await lists.getLegacyListItemTemplateExists();
try {
const legacyTemplateExists = await lists.getLegacyListTemplateExists();
const legacyTemplateListItemsExists = await lists.getLegacyListItemTemplateExists();

// Check if the old legacy lists and items template exists and remove it
if (legacyTemplateExists) {
await lists.deleteLegacyListTemplate();
Expand All @@ -19,7 +20,8 @@ export const removeLegacyTemplatesIfExist = async (lists: ListClient): Promise<v
await lists.deleteLegacyListItemTemplate();
}
} catch (err) {
if (err.statusCode !== 404) {
// 410 error is for ES serverless, this API doesn't exist there any more, so _template request returns 410 error
if (err.statusCode !== 404 && err.statusCode !== 410) {
throw err;
}
}
Expand Down