Skip to content

Commit

Permalink
[1.0][Build] use saved legacy config for 1.x
Browse files Browse the repository at this point in the history
An original update to enable taking settings from a valid legacy
version and applying to current OpenSearch Dashboards was made
here:

#485

However, it explicitly checked for current version being 1.0.0, which
is too strict because ideally all versions of 1.x is compatible.

This makes the config check more relaxed and will taking settings from
a legacy version if the current version is 1.x.

Issue resolved:
#741

Backport PR:
#743

Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla committed Sep 1, 2021
1 parent 9e8f52a commit d07e08b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,17 @@ describe('savedObjects/health_check/isConfigVersionUpgradeable', function () {
isUpgradeableTest('7.10.3-rc1', '1.0.0', false);
isUpgradeableTest('6.7.10', '1.0.0-rc1', false);
isUpgradeableTest('7.10.3', '1.0.0-rc1', false);
isUpgradeableTest('6.8.0', '1.0.1', false);
isUpgradeableTest('7.0.0', '1.0.1', false);
isUpgradeableTest('7.10.2', '1.0.1', false);
isUpgradeableTest('6.8.0-rc1', '1.0.1', false);
isUpgradeableTest('7.0.0-rc1', '1.0.1', false);
isUpgradeableTest('7.10.2-rc1', '1.0.1', false);
isUpgradeableTest('6.8.0', '1.0.1-rc1', false);
isUpgradeableTest('7.0.0', '1.0.1-rc1', false);
isUpgradeableTest('7.10.2', '1.0.1-rc1', false);
isUpgradeableTest('6.8.0', '1.0.1', true);
isUpgradeableTest('7.0.0', '1.0.1', true);
isUpgradeableTest('7.10.2', '1.0.1', true);
isUpgradeableTest('6.8.0-rc1', '1.0.1', true);
isUpgradeableTest('7.0.0-rc1', '1.0.1', true);
isUpgradeableTest('7.10.2-rc1', '1.0.1', true);
isUpgradeableTest('6.8.0', '1.0.1-rc1', true);
isUpgradeableTest('7.0.0', '1.0.1-rc1', true);
isUpgradeableTest('7.10.2', '1.0.1-rc1', true);
isUpgradeableTest('1.0.0-rc1', '1.0.0', true);
isUpgradeableTest('1.0.1', '1.0.0', false);
isUpgradeableTest('7.10.2', '1.1.0', true);
isUpgradeableTest('7.10.2', '2.0.0', false);
});
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function isConfigVersionUpgradeable(
// If the saved config is from the fork and from 6.8.0 to 7.10.2 then we should be able to upgrade.
const savedIsFromPrefork =
semver.gte(savedReleaseVersion, '6.8.0') && semver.lte(savedReleaseVersion, '7.10.2');
const currentVersionIsVersion1 = semver.eq(opensearchDashboardsReleaseVersion, '1.0.0');
const currentVersionIsVersion1 = semver.major(opensearchDashboardsReleaseVersion) === 1;
return (
savedIsLessThanOpenSearchDashboards ||
(savedIsSameAsOpenSearchDashboards && savedRcIsLessThanOpenSearchDashboards) ||
Expand Down

0 comments on commit d07e08b

Please sign in to comment.