Skip to content

Commit

Permalink
[Upgrade Assistant] Hide features that don't need to be migrated from…
Browse files Browse the repository at this point in the history
… flyout (#115535)

* Filter out system indices that dont require migration on server side
* Rename to attrs to migration
* Update flyout snapshot.
  • Loading branch information
sabarasaba authored Oct 19, 2021
1 parent 135b03c commit 128afbb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ const mockedResponse = {
},
],
},
{
feature_name: 'kibana',
minimum_index_version: '7.1.2',
upgrade_status: 'MIGRATION_NEEDED',
indices: [
{
index: '.kibana',
version: '7.1.2',
},
],
},
],
migration_status: 'MIGRATION_NEEDED',
};
Expand Down Expand Up @@ -75,7 +86,12 @@ describe('Migrate system indices API', () => {
method: 'GET',
path: '/_migration/system_features',
});
expect(resp.payload).toEqual(mockedResponse);
expect(resp.payload).toEqual({
...mockedResponse,
features: mockedResponse.features.filter(
(feature) => feature.migration_status !== 'NO_MIGRATION_NEEDED'
),
});
});

it('returns an error if it throws', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export function registerSystemIndicesMigrationRoutes({
const status = await getESSystemIndicesMigrationStatus(client.asCurrentUser);

return response.ok({
body: status,
body: {
...status,
features: status.features.filter(
(feature) => feature.migration_status !== 'NO_MIGRATION_NEEDED'
),
},
});
} catch (error) {
return handleEsError({ error, response });
Expand Down

0 comments on commit 128afbb

Please sign in to comment.