From 6ab90658608fef273a0cb4f2cf90ebf9e9848202 Mon Sep 17 00:00:00 2001 From: Miki Date: Fri, 5 Apr 2024 09:24:46 -0700 Subject: [PATCH] Allow the use of `ignoreVersionMismatch` in non-dev configuration (#6347) Signed-off-by: Miki Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com> --- CHANGELOG.md | 1 + src/core/server/opensearch/opensearch_config.ts | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 607fe4846f61..abaf2f303b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,6 +54,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Workspace] Add workspace id in basePath ([#6060](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6060)) - Implement new home page ([#6065](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6065)) - Add sidecar service ([#5920](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5920)) +- Allow the use of `ignoreVersionMismatch` in non-dev configuration ([#6347](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6347)) - [Multiple Datasource] Use data source filter function before rendering ([#6175](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6175)) - [Chrome] Introduce registerCollapsibleNavHeader to allow plugins to customize the rendering of nav menu header ([#5244](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/5244)) - [Dynamic Configurations] Pass request headers when making application config calls ([#6164](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6164)) diff --git a/src/core/server/opensearch/opensearch_config.ts b/src/core/server/opensearch/opensearch_config.ts index 7ef3a7665a97..ba63e7350753 100644 --- a/src/core/server/opensearch/opensearch_config.ts +++ b/src/core/server/opensearch/opensearch_config.ts @@ -129,19 +129,7 @@ export const configSchema = schema.object({ ), apiVersion: schema.string({ defaultValue: DEFAULT_API_VERSION }), healthCheck: schema.object({ delay: schema.duration({ defaultValue: 2500 }) }), - ignoreVersionMismatch: schema.conditional( - schema.contextRef('dev'), - false, - schema.boolean({ - validate: (rawValue) => { - if (rawValue === true) { - return '"ignoreVersionMismatch" can only be set to true in development mode'; - } - }, - defaultValue: false, - }), - schema.boolean({ defaultValue: false }) - ), + ignoreVersionMismatch: schema.boolean({ defaultValue: false }), disablePrototypePoisoningProtection: schema.maybe(schema.boolean({ defaultValue: false })), }); @@ -216,7 +204,7 @@ export class OpenSearchConfig { public readonly healthCheckDelay: Duration; /** - * Whether to allow opensearch-dashboards to connect to a non-compatible opensearch node. + * Whether to allow opensearch-dashboards to connect to an opensearch node of a different version. */ public readonly ignoreVersionMismatch: boolean;