From 205e181518d2ea7d8a2b988922144a42070a2d0a Mon Sep 17 00:00:00 2001 From: Chris Hesterman Date: Fri, 2 Dec 2022 16:46:25 -0800 Subject: [PATCH] [Bugfix] filter data streams from rollover alias requirement (#429) * Change alignment of Snapshot Management panels in pages/Main/Main.tsx Signed-off-by: Chris Hesterman * Unify vertical button alignment across panels, ContentPanel.tsx Signed-off-by: Chris Hesterman * Update jest snapshots, add ROUTE_STYLE variable Signed-off-by: Chris Hesterman * Add placeholder restore button to Snapshots panel Signed-off-by: Chris Hesterman * Comment out line 20 rollups_spec.js in cypress/integration/ Signed-off-by: Chris Hesterman * Remove unused code and comment cypress/integration/rollups_spec.js Signed-off-by: Chris Hesterman * Starting adaptation/use of existing code for Restore functionality Signed-off-by: Chris Hesterman * Adapt Snapshots.tsx to include RestoreSnapshotFlyout Signed-off-by: Chris Hesterman * Add restoreSnapshot method to SMservice,RestoreSnapshotResponse int Signed-off-by: Chris Hesterman * Implement RestoreSnapshotFlyout open/close Signed-off-by: Chris Hesterman * Make Snapshot name appear on RestoreSnapshotFlyout Signed-off-by: Chris Hesterman * Add/adapt restoreSnapshot to server/SnapshotManagementService Signed-off-by: Chris Hesterman * Add route for restoreSnapshot in server/routes.ts Signed-off-by: Chris Hesterman * Rudimentary restore from snapshot functionality reached, buggy Signed-off-by: Chris Hesterman * Fix index list-snapshot restore, restrict restore to single selection Signed-off-by: Chris Hesterman * Remove console.logs, commented out code Signed-off-by: Chris Hesterman * Create Advanced options accordion for Snapshot restore. Signed-off-by: Chris Hesterman Currently only visually functional. TODO - make it apply the options Signed-off-by: Chris Hesterman * Add initial restore/rename options to ui. Only visual functionality Signed-off-by: Chris Hesterman * Resolve radio button events not firing Signed-off-by: Chris Hesterman Split radio buttons into SnapshotRestoreOption and SnapshotRenameOptions Signed-off-by: Chris Hesterman Move 'restore' button between 'delete' and 'take snapshot' Signed-off-by: Chris Hesterman Set default rename option to 'add prefix' Signed-off-by: Chris Hesterman * Add AddPrefixInput, remove unused component RestoreSnapshotInitialOptions Signed-off-by: Chris Hesterman * Fix issues with restore specific indices Signed-off-by: Chris Hesterman Implement first 4 Advanced restore options functionality Signed-off-by: Chris Hesterman * Begin cypress testing for snapshots Signed-off-by: Chris Hesterman Passing tests for create repo and create snapshot Signed-off-by: Chris Hesterman * Begin cypress testing Snapshots. Create repo and Create snapshot done Signed-off-by: Chris Hesterman * Implement add_prefix functionality for snapshot restore Signed-off-by: Chris Hesterman * Implement rename indices option for restore snapshot Signed-off-by: Chris Hesterman * Remove console.logs, unusted variables in SnapshotFlyout, SMservice Signed-off-by: Chris Hesterman * Add full stop to help text/errors, add RESTORE_OPTIONS enum Signed-off-by: Chris Hesterman * Add back line 20 in rollups_spec, required by changes in 2.3 release. Signed-off-by: Chris Hesterman * Remove unused getRepos func, add repo prop, trim state in RestoreFlyout Signed-off-by: Chris Hesterman * Add increment to 2.3.0 Signed-off-by: Chris Hesterman * Version bump 2.3.0 to 2.3 1 Signed-off-by: Chris Hesterman * Add version bump 2.3.1 for OS in cypress-workflow.yml Signed-off-by: Chris Hesterman * Remove 2.3.1 bump Signed-off-by: Chris Hesterman * Change 2.4 to 2.4.0 opensearch_dashboards.json Signed-off-by: Chris Hesterman * Update package.json, opensearch-dashboards.json Signed-off-by: Chris Hesterman * Update package.json, opensearch_dashboards.json Signed-off-by: Chris Hesterman * Update OSD to 2.4.1, update loader-utils, ts-loader, webpack Signed-off-by: Chris Hesterman * Backport to 1.x Signed-off-by: Chris Hesterman * Revert "Backport to 1.x", backport failed Signed-off-by: Chris Hesterman This reverts commit f77922babbcc011f94259460cf4c330effe8bd34. Signed-off-by: Chris Hesterman * Implement check for singleIndex/datastream to address alias requirement Signed-off-by: Chris Hesterman * Run version sync, adj. OSDB versions in workflows Signed-off-by: Chris Hesterman * Set OSDB version to 2.4 in workflows Signed-off-by: Chris Hesterman * Version bump to 2.4.1 to keep it working Signed-off-by: Chris Hesterman * Remove unintended dependency bumps Signed-off-by: Chris Hesterman * Implement fix to exempt data streams from rollover alias requirement Signed-off-by: Chris Hesterman * Fresh bootstrap to update yarn lock Signed-off-by: Chris Hesterman Signed-off-by: Chris Hesterman (cherry picked from commit f983e9d3d43dee15def3dd0d5193064296968cab) --- .../Indices/components/ApplyPolicyModal/ApplyPolicyModal.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/pages/Indices/components/ApplyPolicyModal/ApplyPolicyModal.tsx b/public/pages/Indices/components/ApplyPolicyModal/ApplyPolicyModal.tsx index 5b62dc363..0b9072112 100644 --- a/public/pages/Indices/components/ApplyPolicyModal/ApplyPolicyModal.tsx +++ b/public/pages/Indices/components/ApplyPolicyModal/ApplyPolicyModal.tsx @@ -179,8 +179,9 @@ export default class ApplyPolicyModal extends Component { const { hasRolloverAction } = this.state; const { indices } = this.props; + const isDataStream = indices[0].includes(".ds"); const hasSingleIndexSelected = indices.length === 1; - const requiresAlias = hasRolloverAction && hasSingleIndexSelected; + const requiresAlias = hasRolloverAction && hasSingleIndexSelected && !isDataStream; const hasAliasError = requiresAlias && !rolloverAlias; return hasAliasError ? "Required" : ""; };