From 9b140e39553a460117e94cf77b4e45a95320842e Mon Sep 17 00:00:00 2001 From: Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:18:07 +0530 Subject: [PATCH 1/2] Adding RamakrishnaChilaka as maintainer (#1081) Signed-off-by: Ramakrishna Chilaka --- MAINTAINERS.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS.md b/MAINTAINERS.md index c6b9a5769..22fa559df 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -5,7 +5,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje ## Current Maintainers | Maintainer | GitHub ID | Affiliation | -| --------------------- | ----------------------------------------------------- | ----------- | +|-----------------------| ----------------------------------------------------- | ----------- | | Bowen Lan | [bowenlan-amzn](https://github.com/bowenlan-amzn) | Amazon | | Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02) | Amazon | | Praveen Sameneni | [praveensameneni](https://github.com/praveensameneni) | Amazon | @@ -20,6 +20,7 @@ This document contains a list of maintainers in this repo. See [opensearch-proje | Surya Sashank Nistala | [eirsep](https://github.com/eirsep) | Amazon | | Rohit Ashiwal | [r1walz](https://github.com/r1walz) | Amazon | | Vikas Bansal | [vikasvb90](https://github.com/vikasvb90) | Amazon | +| Ramakrishna Chilaka | [RamakrishnaChilaka](https://github.com/RamakrishnaChilaka) | Amazon | ## Emeritus From 50c2275589fcfe9427d0db88a9a91eebb3325e12 Mon Sep 17 00:00:00 2001 From: Ramakrishna Chilaka <49393831+RamakrishnaChilaka@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:45:56 +0530 Subject: [PATCH 2/2] Adding dataVersionFilter support to MDS to enable version decoupling (#1080) * Adding dataVersionFilter support to MDS to enable version decoupling Signed-off-by: Ramakrishna Chilaka * added check for checking available plugins on a datasource Signed-off-by: Ramakrishna Chilaka --------- Signed-off-by: Ramakrishna Chilaka --- opensearch_dashboards.json | 4 +++- public/pages/Main/Main.tsx | 26 +++++++++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index f2e5d849d..5493c743e 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -6,5 +6,7 @@ "requiredPlugins": ["navigation", "opensearchDashboardsReact"], "optionalPlugins": ["managementOverview", "dataSource", "dataSourceManagement"], "server": true, - "ui": true + "ui": true, + "supportedOSDataSourceVersions": ">=2.0.0", + "requiredOSDataSourcePlugins": ["opensearch-index-management"] } diff --git a/public/pages/Main/Main.tsx b/public/pages/Main/Main.tsx index e462fe10d..73498d603 100644 --- a/public/pages/Main/Main.tsx +++ b/public/pages/Main/Main.tsx @@ -7,7 +7,9 @@ import React, { Component } from "react"; import { Switch, Route, Redirect, RouteComponentProps } from "react-router-dom"; // @ts-ignore import { EuiSideNav, EuiPage, EuiPageBody, EuiPageSideBar } from "@elastic/eui"; -import { CoreStart, HttpSetup, MountPoint } from "opensearch-dashboards/public"; +import { CoreStart, HttpSetup, MountPoint, SavedObject } from "opensearch-dashboards/public"; +import queryString from "query-string"; +import semver from "semver"; import Policies from "../Policies"; import ManagedIndices from "../ManagedIndices"; import Indices from "../Indices"; @@ -59,13 +61,14 @@ import Notifications from "../Notifications"; import ComposableTemplates from "../ComposableTemplates"; import CreateComposableTemplate from "../CreateComposableTemplate"; import { DataSourceMenuContext, DataSourceMenuProperties } from "../../services/DataSourceMenuContext"; -import queryString from "query-string"; import { DataSourceManagementPluginSetup, DataSourceSelectableConfig, DataSourceViewConfig, } from "../../../../../src/plugins/data_source_management/public"; import { DataSourceOption } from "../../../../../src/plugins/data_source_management/public/components/data_source_menu/types"; +import * as pluginManifest from "../../../opensearch_dashboards.json"; +import { DataSourceAttributes } from "../../../../../src/plugins/data_source/common/data_sources"; enum Navigation { IndexManagement = "Index Management", @@ -192,8 +195,8 @@ export default class Main extends Component { dataSourceLabel = parsedDataSourceLabel || ""; } this.state = { - dataSourceId: dataSourceId, - dataSourceLabel: dataSourceLabel, + dataSourceId, + dataSourceLabel, dataSourceReadOnly: false, dataSourceLoading: props.multiDataSourceEnabled, }; @@ -257,6 +260,15 @@ export default class Main extends Component { } }; + dataSourceFilterFn = (dataSource: SavedObject) => { + const engineVersion = dataSource?.attributes?.dataSourceVersion || ""; + const availablePlugins = dataSource?.attributes?.installedPlugins || []; + return ( + semver.satisfies(engineVersion, pluginManifest.supportedOSDataSourceVersions) && + pluginManifest.requiredOSDataSourcePlugins.every((plugin) => availablePlugins.includes(plugin)) + ); + }; + render() { const { location: { pathname }, @@ -400,6 +412,7 @@ export default class Main extends Component { componentConfig={{ activeOption, fullWidth: false, + dataSourceFilter: this.dataSourceFilterFn, }} /> ) : ( @@ -412,6 +425,7 @@ export default class Main extends Component { fullWidth: false, activeOption, onSelectedDataSources: this.onSelectedDataSources, + dataSourceFilter: this.dataSourceFilterFn, }} /> ) @@ -441,13 +455,13 @@ export default class Main extends Component { componentConfig={{ activeOption, fullWidth: false, + dataSourceFilter: this.dataSourceFilterFn, }} /> )} /> { fullWidth: false, activeOption, onSelectedDataSources: this.onSelectedDataSources, + dataSourceFilter: this.dataSourceFilterFn, }} /> )} /> + )} {!this.state.dataSourceLoading && (