Skip to content

Commit

Permalink
bug-fix: Restore snapshot shouldn't restore index alias always
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
  • Loading branch information
Sandeep Kumawat committed Nov 5, 2024
1 parent fc06af9 commit 625404e
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,24 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr
};

onToggle = (e: ChangeEvent<HTMLInputElement>) => {
const { restore_specific_indices, restore_all_indices, customize_index_settings, ignore_index_settings } = RESTORE_OPTIONS;
const {
restore_specific_indices,
restore_all_indices,
customize_index_settings,
ignore_index_settings,
restore_aliases,
} = RESTORE_OPTIONS;

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

if (e.target.id === restore_aliases) {
this.setState({ snapshot: _.set(this.state.snapshot!, e.target.id, e.target.checked) });
return;
}

if (e.target.id === restore_all_indices) {
this.setState({
restoreSpecific: false,
Expand Down Expand Up @@ -482,7 +493,7 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr

<SnapshotRestoreAdvancedOptions
getIndexSettings={this.getIndexSettings}
restoreAliases={String(_.get(snapshot, restore_aliases, true)) == "true"}
restoreAliases={String(_.get(snapshot, restore_aliases, false)) == "true"}
onRestoreAliasesToggle={this.onToggle}
restoreClusterState={String(_.get(snapshot, include_global_state, false)) == "true"}
onRestoreClusterStateToggle={this.onToggle}
Expand Down

0 comments on commit 625404e

Please sign in to comment.