Skip to content

Commit

Permalink
[Deprecation] Deprecate the apiVersion: master value and replace with…
Browse files Browse the repository at this point in the history
… main

Resolves issue - opensearch-project#1687

Signed-off-by: Manasvini B Suryanarayana <[email protected]>
  • Loading branch information
manasvinibs committed Jun 24, 2022
1 parent ae6cb80 commit bc993c9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const createStartContractMock = () => {
new BehaviorSubject<CoreUsageData>({
config: {
opensearch: {
apiVersion: 'master',
apiVersion: 'main',
customHeadersConfigured: false,
healthCheckDelayMs: 2500,
logQueries: false,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/opensearch/legacy/cluster_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test('parses minimally specified config', () => {
expect(
parseOpenSearchClientConfig(
{
apiVersion: 'master',
apiVersion: 'main',
customHeaders: { xsrf: 'something' },
logQueries: false,
sniffOnStart: false,
Expand Down Expand Up @@ -180,7 +180,7 @@ test('parses config timeouts of moment.Duration type', () => {
expect(
parseOpenSearchClientConfig(
{
apiVersion: 'master',
apiVersion: 'main',
customHeaders: { xsrf: 'something' },
logQueries: false,
sniffOnStart: false,
Expand Down Expand Up @@ -359,7 +359,7 @@ describe('#customHeaders', () => {
const headerKey = Object.keys(DEFAULT_HEADERS)[0];
const parsedConfig = parseOpenSearchClientConfig(
{
apiVersion: 'master',
apiVersion: 'main',
customHeaders: { [headerKey]: 'foo' },
logQueries: false,
sniffOnStart: false,
Expand All @@ -379,7 +379,7 @@ describe('#log', () => {
test('default logger with #logQueries = false', () => {
const parsedConfig = parseOpenSearchClientConfig(
{
apiVersion: 'master',
apiVersion: 'main',
customHeaders: { xsrf: 'something' },
logQueries: false,
sniffOnStart: false,
Expand Down Expand Up @@ -423,7 +423,7 @@ describe('#log', () => {
test('default logger with #logQueries = true', () => {
const parsedConfig = parseOpenSearchClientConfig(
{
apiVersion: 'master',
apiVersion: 'main',
customHeaders: { xsrf: 'something' },
logQueries: true,
sniffOnStart: false,
Expand Down Expand Up @@ -482,7 +482,7 @@ describe('#log', () => {

const parsedConfig = parseOpenSearchClientConfig(
{
apiVersion: 'master',
apiVersion: 'main',
customHeaders: { xsrf: 'something' },
logQueries: true,
sniffOnStart: false,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/opensearch/opensearch_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (6.7, 7.1 or `main`) client will be connecting to.
*/
public readonly apiVersion: string;

Expand Down

0 comments on commit bc993c9

Please sign in to comment.