Skip to content

Commit

Permalink
Merge pull request #3373 from terascope/test-helper-fix
Browse files Browse the repository at this point in the history
fix startup issue with opensearch v2
  • Loading branch information
jsnoble authored Jul 10, 2023
2 parents e1a7f4a + b1b13ee commit 0aaadd1
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"bunyan": "^1.8.15",
"elasticsearch-store": "^0.67.1",
"elasticsearch-store": "^0.67.2",
"fs-extra": "^10.1.0",
"ms": "^2.1.3",
"nanoid": "^3.3.4",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "teraslice-workspace",
"displayName": "Teraslice",
"version": "0.85.0",
"version": "0.86.0",
"private": true,
"homepage": "https://github.com/terascope/teraslice",
"bugs": {
Expand Down
7 changes: 6 additions & 1 deletion packages/elasticsearch-api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,11 @@ module.exports = function elasticsearchApi(client, logger, _opConfig) {
return distribution === ElasticsearchDistribution.elasticsearch && majorVersion === 8;
}

function isOpensearch2() {
const { distribution, majorVersion } = getClientMetadata();
return distribution === ElasticsearchDistribution.opensearch && majorVersion === 2;
}

function _fixMappingRequest(_params, isTemplate) {
if (!_params || !_params.body) {
throw new Error('Invalid mapping request');
Expand Down Expand Up @@ -1000,7 +1005,7 @@ module.exports = function elasticsearchApi(client, logger, _opConfig) {
}
}

if (isElasticsearch8(client)) {
if (isElasticsearch8(client) || isOpensearch2(client)) {
delete defaultParams.includeTypeName;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/elasticsearch-api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/elasticsearch-api",
"displayName": "Elasticsearch API",
"version": "3.6.0",
"version": "3.6.1",
"description": "Elasticsearch client api used across multiple services, handles retries and exponential backoff",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-api#readme",
"bugs": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"@opensearch-project/opensearch": "^1.2.0",
"@types/elasticsearch": "^5.0.40",
"elasticsearch": "^15.4.1",
"elasticsearch-store": "^0.67.1",
"elasticsearch-store": "^0.67.2",
"elasticsearch6": "npm:@elastic/elasticsearch@^6.7.0",
"elasticsearch7": "npm:@elastic/elasticsearch@^7.0.0",
"elasticsearch8": "npm:@elastic/elasticsearch@^8.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/elasticsearch-store/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "elasticsearch-store",
"displayName": "Elasticsearch Store",
"version": "0.67.1",
"version": "0.67.2",
"description": "An API for managing an elasticsearch index, with versioning and migration support.",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/elasticsearch-store#readme",
"bugs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function convertIndicesPutTemplateParams(
const {
majorVersion,
distribution,
version
version,
} = distributionMeta;

if (distribution === ElasticsearchDistribution.elasticsearch) {
Expand Down Expand Up @@ -57,11 +57,18 @@ export function convertIndicesPutTemplateParams(
const {
include_type_name,
master_timeout,
body,
...parsedParams
} = params;

const newBody = {
...body,
mappings: ensureNoTypeInMapping(body?.mappings),
};

return {
...parsedParams,
body: newBody,
...(master_timeout !== undefined && { cluster_manager_timeout: master_timeout }),
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/terafoundation/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "terafoundation",
"displayName": "Terafoundation",
"version": "0.45.1",
"version": "0.45.2",
"description": "A Clustering and Foundation tool for Terascope Tools",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/terafoundation#readme",
"bugs": {
Expand Down Expand Up @@ -36,7 +36,7 @@
"convict-format-with-moment": "^6.2.0",
"convict-format-with-validator": "^6.2.0",
"elasticsearch": "^15.4.1",
"elasticsearch-store": "^0.67.1",
"elasticsearch-store": "^0.67.2",
"js-yaml": "^4.1.0",
"mongoose": "~6.6.5",
"nanoid": "^3.3.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/teraslice-state-storage/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@terascope/teraslice-state-storage",
"displayName": "Teraslice State Storage",
"version": "0.39.0",
"version": "0.39.1",
"description": "State storage operation api for teraslice",
"homepage": "https://github.com/terascope/teraslice/tree/master/packages/teraslice-state-storage#readme",
"bugs": {
Expand All @@ -23,7 +23,7 @@
"test:watch": "ts-scripts test --watch . --"
},
"dependencies": {
"@terascope/elasticsearch-api": "^3.6.0",
"@terascope/elasticsearch-api": "^3.6.1",
"@terascope/utils": "^0.46.0"
},
"engines": {
Expand Down
6 changes: 3 additions & 3 deletions packages/teraslice/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "teraslice",
"displayName": "Teraslice",
"version": "0.85.0",
"version": "0.86.0",
"description": "Distributed computing platform for processing JSON data",
"homepage": "https://github.com/terascope/teraslice#readme",
"bugs": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"ms": "^2.1.3"
},
"dependencies": {
"@terascope/elasticsearch-api": "^3.6.0",
"@terascope/elasticsearch-api": "^3.6.1",
"@terascope/job-components": "^0.59.0",
"@terascope/teraslice-messaging": "^0.29.0",
"@terascope/utils": "^0.46.0",
Expand All @@ -61,7 +61,7 @@
"semver": "^7.3.8",
"socket.io": "^1.7.4",
"socket.io-client": "^1.7.4",
"terafoundation": "^0.45.1",
"terafoundation": "^0.45.2",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down

0 comments on commit 0aaadd1

Please sign in to comment.