[Upgrade Assistant] Hide features that don't need to be migrated from flyout (#115535)

* Filter out system indices that dont require migration on server side
* Rename to attrs to migration
* Update flyout snapshot.
This commit is contained in:
Ignacio Rivas 2021-10-20 00:40:05 +01:00 committed by GitHub
parent 135b03ce6b
commit 128afbbfd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -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',
};
@ -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 () => {

View file

@ -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 });