Skip to content

Commit 625404e

Browse files
author
Sandeep Kumawat
committed
bug-fix: Restore snapshot shouldn't restore index alias always
Signed-off-by: Sandeep Kumawat <[email protected]>
1 parent fc06af9 commit 625404e

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

public/pages/Snapshots/components/RestoreSnapshotFlyout/RestoreSnapshotFlyout.tsx

+13-2
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,24 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr
289289
};
290290

291291
onToggle = (e: ChangeEvent<HTMLInputElement>) => {
292-
const { restore_specific_indices, restore_all_indices, customize_index_settings, ignore_index_settings } = RESTORE_OPTIONS;
292+
const {
293+
restore_specific_indices,
294+
restore_all_indices,
295+
customize_index_settings,
296+
ignore_index_settings,
297+
restore_aliases,
298+
} = RESTORE_OPTIONS;
293299

294300
if (e.target.id === restore_specific_indices) {
295301
this.setState({ restoreSpecific: true, snapshot: _.set(this.state.snapshot!, e.target.id, e.target.checked) });
296302
return;
297303
}
298304

305+
if (e.target.id === restore_aliases) {
306+
this.setState({ snapshot: _.set(this.state.snapshot!, e.target.id, e.target.checked) });
307+
return;
308+
}
309+
299310
if (e.target.id === restore_all_indices) {
300311
this.setState({
301312
restoreSpecific: false,
@@ -482,7 +493,7 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr
482493

483494
<SnapshotRestoreAdvancedOptions
484495
getIndexSettings={this.getIndexSettings}
485-
restoreAliases={String(_.get(snapshot, restore_aliases, true)) == "true"}
496+
restoreAliases={String(_.get(snapshot, restore_aliases, false)) == "true"}
486497
onRestoreAliasesToggle={this.onToggle}
487498
restoreClusterState={String(_.get(snapshot, include_global_state, false)) == "true"}
488499
onRestoreClusterStateToggle={this.onToggle}

0 commit comments

Comments
 (0)