Skip to content

Commit

Permalink
filter system indices from cat API request
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Jul 1, 2021
1 parent 81b9e73 commit b4d1c18
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion x-pack/plugins/index_management/server/lib/fetch_indices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ async function fetchIndicesCall(
query: catQuery,
});

// System indices may show up in _cat APIs, as these APIs are primarily used for troubleshooting
// For now, we filter them out and only return index information for the indices we have
// In the future, we should migrate away from using cat APIs (https://github.com/elastic/kibana/issues/57286)
const filteredCatHits = catHits.filter((hit) => typeof indices[hit.index] !== 'undefined');

// The two responses should be equal in the number of indices returned
return catHits.map((hit) => {
return filteredCatHits.map((hit) => {
const index = indices[hit.index];
const aliases = Object.keys(index.aliases);

Expand Down

0 comments on commit b4d1c18

Please sign in to comment.