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
#1206)

(cherry picked from commit 2d7c80b)

Signed-off-by: Sandeep Kumawat <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Sandeep Kumawat <[email protected]>
Co-authored-by: Ramakrishna Chilaka <[email protected]>
  • Loading branch information
4 people authored Dec 16, 2024
1 parent d808d4e commit 03230b5
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 03230b5

Please sign in to comment.