Skip to content

Commit

Permalink
bug-fix: Restore snapshot shouldn't restore index alias always (#1193)
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
Co-authored-by: Sandeep Kumawat <[email protected]>
(cherry picked from commit 2d7c80b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and Sandeep Kumawat committed Nov 5, 2024
1 parent bbf8c25 commit dc8b5b4
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 dc8b5b4

Please sign in to comment.