diff --git a/src/core/server/core_usage_data/core_usage_data_service.mock.ts b/src/core/server/core_usage_data/core_usage_data_service.mock.ts index becea6f17c80..5e1bcbe7867b 100644 --- a/src/core/server/core_usage_data/core_usage_data_service.mock.ts +++ b/src/core/server/core_usage_data/core_usage_data_service.mock.ts @@ -39,7 +39,7 @@ const createStartContractMock = () => { new BehaviorSubject({ config: { opensearch: { - apiVersion: 'master', + apiVersion: 'main', customHeadersConfigured: false, healthCheckDelayMs: 2500, logQueries: false, diff --git a/src/core/server/opensearch/legacy/cluster_client.test.ts b/src/core/server/opensearch/legacy/cluster_client.test.ts index 8d91a8e22ed1..c7820952b451 100644 --- a/src/core/server/opensearch/legacy/cluster_client.test.ts +++ b/src/core/server/opensearch/legacy/cluster_client.test.ts @@ -48,7 +48,7 @@ const logger = loggingSystemMock.create(); afterEach(() => jest.clearAllMocks()); test('#constructor creates client with parsed config', () => { - const mockOpenSearchClientConfig = { apiVersion: 'opensearch-client-master' }; + const mockOpenSearchClientConfig = { apiVersion: 'opensearch-client-main' }; mockParseOpenSearchClientConfig.mockReturnValue(mockOpenSearchClientConfig); const mockOpenSearchConfig = { apiVersion: 'opensearch-version' } as any; diff --git a/src/core/server/opensearch/legacy/opensearch_client_config.test.ts b/src/core/server/opensearch/legacy/opensearch_client_config.test.ts index e7ccccb286ac..4b4451c8ed41 100644 --- a/src/core/server/opensearch/legacy/opensearch_client_config.test.ts +++ b/src/core/server/opensearch/legacy/opensearch_client_config.test.ts @@ -42,7 +42,7 @@ test('parses minimally specified config', () => { expect( parseOpenSearchClientConfig( { - apiVersion: 'master', + apiVersion: 'main', customHeaders: { xsrf: 'something' }, logQueries: false, sniffOnStart: false, @@ -50,11 +50,12 @@ test('parses minimally specified config', () => { hosts: ['http://localhost/opensearch'], requestHeadersWhitelist: [], }, + logger.get() ) ).toMatchInlineSnapshot(` Object { - "apiVersion": "master", + "apiVersion": "main", "hosts": Array [ Object { "headers": Object { @@ -180,7 +181,7 @@ test('parses config timeouts of moment.Duration type', () => { expect( parseOpenSearchClientConfig( { - apiVersion: 'master', + apiVersion: 'main', customHeaders: { xsrf: 'something' }, logQueries: false, sniffOnStart: false, @@ -191,11 +192,12 @@ test('parses config timeouts of moment.Duration type', () => { hosts: ['http://localhost:9200/opensearch'], requestHeadersWhitelist: [], }, + logger.get() ) ).toMatchInlineSnapshot(` Object { - "apiVersion": "master", + "apiVersion": "main", "hosts": Array [ Object { "headers": Object { @@ -359,7 +361,7 @@ describe('#customHeaders', () => { const headerKey = Object.keys(DEFAULT_HEADERS)[0]; const parsedConfig = parseOpenSearchClientConfig( { - apiVersion: 'master', + apiVersion: 'main', customHeaders: { [headerKey]: 'foo' }, logQueries: false, sniffOnStart: false, @@ -379,7 +381,7 @@ describe('#log', () => { test('default logger with #logQueries = false', () => { const parsedConfig = parseOpenSearchClientConfig( { - apiVersion: 'master', + apiVersion: 'main', customHeaders: { xsrf: 'something' }, logQueries: false, sniffOnStart: false, @@ -423,7 +425,7 @@ describe('#log', () => { test('default logger with #logQueries = true', () => { const parsedConfig = parseOpenSearchClientConfig( { - apiVersion: 'master', + apiVersion: 'main', customHeaders: { xsrf: 'something' }, logQueries: true, sniffOnStart: false, @@ -482,7 +484,7 @@ describe('#log', () => { const parsedConfig = parseOpenSearchClientConfig( { - apiVersion: 'master', + apiVersion: 'main', customHeaders: { xsrf: 'something' }, logQueries: true, sniffOnStart: false, diff --git a/src/core/server/opensearch/opensearch_config.ts b/src/core/server/opensearch/opensearch_config.ts index bbb26dba29cf..807b636d2a5a 100644 --- a/src/core/server/opensearch/opensearch_config.ts +++ b/src/core/server/opensearch/opensearch_config.ts @@ -208,7 +208,7 @@ export class OpenSearchConfig { public readonly ignoreVersionMismatch: boolean; /** - * Version of the OpenSearch (6.7, 7.1 or `master`) client will be connecting to. + * Version of the OpenSearch (1.1, 2.1 or `main`) client will be connecting to. */ public readonly apiVersion: string;