Skip to content

Commit

Permalink
[Tests] remove include_type_name from OpenSearch Archiver (#1334)
Browse files Browse the repository at this point in the history
include_type_name was removed in opensearch-project/OpenSearch#2397

OpenSearch Archiver loads data to OpenSearch from data.json into OpenSearch for
E2E tests and integration tests but will need to verify if this causes breakage in
migration from older versions of the application.

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
  • Loading branch information
kavilla authored Mar 10, 2022
1 parent b2979c8 commit 852e2ac
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ describe('opensearchArchiver: createCreateIndexStream()', () => {
sinon.assert.calledWith(client.indices.create as sinon.SinonSpy, {
method: 'PUT',
index: 'index',
include_type_name: false,
body: {
settings: undefined,
mappings: undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ export function createCreateIndexStream({
async function handleIndex(record: DocRecord) {
const { index, settings, mappings, aliases } = record.value;

// Determine if the mapping belongs to a pre-7.0 instance, for BWC tests, mainly
const isPre7Mapping = !!mappings && Object.keys(mappings).length > 0 && !mappings.properties;
const isOpenSearchDashboards = index.startsWith('.kibana');

async function attemptToCreate(attemptNumber = 1) {
Expand All @@ -93,13 +91,12 @@ export function createCreateIndexStream({
await client.indices.create({
method: 'PUT',
index,
include_type_name: isPre7Mapping,
body: {
settings,
mappings,
aliases,
},
} as any); // include_type_name is not properly defined
} as any);

stats.createdIndex(index, { settings });
} catch (err) {
Expand Down

0 comments on commit 852e2ac

Please sign in to comment.