From 696c927f56c86940c67611d16e1a16eb79db417d Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 19:05:23 -0700 Subject: [PATCH] Allow the use of `ignoreVersionMismatch` in non-dev configuration (#6347) (#6354) Signed-off-by: Miki Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com> (cherry picked from commit 6ab90658608fef273a0cb4f2cf90ebf9e9848202) Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- src/core/server/opensearch/opensearch_config.ts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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;