diff --git a/changelogs/fragments/10818.yml b/changelogs/fragments/10818.yml new file mode 100644 index 000000000000..c5da6d8ae8f7 --- /dev/null +++ b/changelogs/fragments/10818.yml @@ -0,0 +1,2 @@ +fix: +- Update the version check logic ([#10818](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/10818)) \ No newline at end of file diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.ts index e5d61f5b26a7..99404b10273c 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.ts @@ -292,9 +292,9 @@ function isVersionCompatible( return false; } - return semver.eq( - coercedActualOpenSearchDashboardsVersion, - coercedExpectedOpenSearchDashboardsVersion + return ( + coercedActualOpenSearchDashboardsVersion.major === + coercedExpectedOpenSearchDashboardsVersion.major ); } /** diff --git a/src/core/server/plugins/discovery/plugins_discovery.test.ts b/src/core/server/plugins/discovery/plugins_discovery.test.ts index 191864a76d44..0173160e334f 100644 --- a/src/core/server/plugins/discovery/plugins_discovery.test.ts +++ b/src/core/server/plugins/discovery/plugins_discovery.test.ts @@ -53,7 +53,7 @@ const Plugins = { 'opensearch_dashboards.json': JSON.stringify({ version: '1' }), }), incompatible: () => ({ - 'opensearch_dashboards.json': JSON.stringify({ id: 'plugin', version: '1' }), + 'opensearch_dashboards.json': JSON.stringify({ id: 'plugin', version: '2.0.0' }), }), missingManifest: () => ({}), inaccessibleManifest: () => ({