mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -04:00
[Snapshot Restore] Fix broken Snapshot restore form (#161113)
Fix https://github.com/elastic/kibana/issues/160974 Fix https://github.com/elastic/kibana/issues/160929 ## Summary From Es 8.10, the `version` field from the Get Snapshot response has a different format - it will no longer be a string representing the release version, but rather it will be a string representing the version id (see https://github.com/elastic/kibana/issues/160974#issuecomment-1618087194 for more details). This PR replaces the use of the `version` field with the `versionId` field when checking in the Snapshot Restore form if the current version is greater than 7.12 (which corresponds to `versionID` 7120099). The PR also unskips the functional test that failed with the promotion of Es to 8.10. **How to test:** 1. Start Es with `yarn es snapshot -E path.repo=./tmp/snap` and Kibana with `yarn start` 2. Go to Stack Management -> Snapshot and Restore 3. Create a Shared File System repository with location `./tmp/snap` 4. Create a policy that uses the repository created in the previous step. 5. Run the policy to create a snapshot. 6. Go to the Snapshots tab and click the Restore button for the created snapshot. 7. Verify that the Snapshot restore form works as expected. --------- Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
6d2603b369
commit
fa90a2f080
2 changed files with 6 additions and 6 deletions
|
@ -7,7 +7,6 @@
|
||||||
|
|
||||||
import React, { Fragment, useState, useMemo } from 'react';
|
import React, { Fragment, useState, useMemo } from 'react';
|
||||||
import { FormattedMessage } from '@kbn/i18n-react';
|
import { FormattedMessage } from '@kbn/i18n-react';
|
||||||
import semverGt from 'semver/functions/gt';
|
|
||||||
import {
|
import {
|
||||||
EuiButtonEmpty,
|
EuiButtonEmpty,
|
||||||
EuiDescribedFormGroup,
|
EuiDescribedFormGroup,
|
||||||
|
@ -61,7 +60,7 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
|
||||||
indices: unfilteredSnapshotIndices,
|
indices: unfilteredSnapshotIndices,
|
||||||
dataStreams: snapshotDataStreams = [],
|
dataStreams: snapshotDataStreams = [],
|
||||||
includeGlobalState: snapshotIncludeGlobalState,
|
includeGlobalState: snapshotIncludeGlobalState,
|
||||||
version,
|
versionId,
|
||||||
featureStates: snapshotIncludeFeatureStates,
|
featureStates: snapshotIncludeFeatureStates,
|
||||||
} = snapshotDetails;
|
} = snapshotDetails;
|
||||||
|
|
||||||
|
@ -647,8 +646,10 @@ export const RestoreSnapshotStepLogistics: React.FunctionComponent<StepProps> =
|
||||||
defaultMessage="Restores the configuration, history, and other data stored in Elasticsearch by a feature such as Elasticsearch security."
|
defaultMessage="Restores the configuration, history, and other data stored in Elasticsearch by a feature such as Elasticsearch security."
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Only display callout if includeFeatureState is enabled and the snapshot was created by ES 7.12+ */}
|
{/* Only display callout if includeFeatureState is enabled and the snapshot was created by ES 7.12+
|
||||||
{semverGt(version, '7.12.0') && isFeatureStatesToggleEnabled && (
|
The versionId field represents the build id of the ES version. We check if the current ES version is >7.12
|
||||||
|
by comparing its build id with the build id of ES 7.12, which is 7120099. */}
|
||||||
|
{versionId > 7120099 && isFeatureStatesToggleEnabled && (
|
||||||
<>
|
<>
|
||||||
<EuiSpacer size="s" />
|
<EuiSpacer size="s" />
|
||||||
<SystemIndicesOverwrittenCallOut featureStates={restoreSettings?.featureStates} />
|
<SystemIndicesOverwrittenCallOut featureStates={restoreSettings?.featureStates} />
|
||||||
|
|
|
@ -15,8 +15,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
|
||||||
const es = getService('es');
|
const es = getService('es');
|
||||||
const security = getService('security');
|
const security = getService('security');
|
||||||
|
|
||||||
// FAILING ES PROMOTION: https://github.com/elastic/kibana/issues/160929
|
describe('Snapshot restore', function () {
|
||||||
describe.skip('Snapshot restore', function () {
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
await security.testUser.setRoles(['snapshot_restore_user'], { skipBrowserRefresh: true });
|
await security.testUser.setRoles(['snapshot_restore_user'], { skipBrowserRefresh: true });
|
||||||
await pageObjects.common.navigateToApp('snapshotRestore');
|
await pageObjects.common.navigateToApp('snapshotRestore');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue