Skip to content

Commit

Permalink
Allow plugin manifest config to define semver compatible OpenSearch p…
Browse files Browse the repository at this point in the history
…lugin and verify if it is installed on the cluster

Signed-off-by: Manasvini B Suryanarayana <[email protected]>
  • Loading branch information
manasvinibs committed Sep 5, 2023
1 parent f9d3c34 commit 4bfbf97
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/server/plugins/plugins_system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { CatPluginsResponse } from '@opensearch-project/opensearch/api/types';
import { CoreContext } from '../core_context';
import { Logger } from '../logging';
import { PluginWrapper } from './plugin';
import { DiscoveredPlugin, PluginName } from './types';
import { DiscoveredPlugin, PluginName, CompatibleOpenSearchPluginVersions } from './types';
import { createPluginSetupContext, createPluginStartContext } from './plugin_context';
import { PluginsServiceSetupDeps, PluginsServiceStartDeps } from './plugins_service';
import { PluginDependencies } from '.';
Expand Down
27 changes: 27 additions & 0 deletions src/core/server/plugins/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,33 @@ export interface PluginDependencies {
asOpaqueIds: ReadonlyMap<PluginOpaqueId, PluginOpaqueId[]>;
}

// An interface defining OpenSearch plugin component name and semver compatible version range of
// OpenSearch plugin to the plugin manifest.
// This is used to check the compatibility of the plugin.
// The plugin manifest is defined in the plugin's opensearch_dashboards.json file.
//
// @example
//
// "opensearch-dashboards-plugin-sample": {
// "opensearchDashboardsVersion": "2.0.0",
// "requiredPlugins": [
// "opensearch-dashboards-sample-data"
// ],
// "requiredOpenSearchPlugins": [
// {
// "id": "opensearch-dashboards-sample-data",
// "versionRange": "^2.0.0"
// }
// ],
// "requiredBundles": [
// "opensearch-dashboards-sample-data"
// ]
// }
export interface CompatibleOpenSearchPluginVersions {
id: PluginName;
versionRange: string;
}

/**
* Describes the set of required and optional properties plugin can define in its
* mandatory JSON manifest file.
Expand Down

0 comments on commit 4bfbf97

Please sign in to comment.