Skip to content

Commit

Permalink
Try to fix v2 migrations for pre-release builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolf committed Jan 21, 2021
1 parent cebb9c0 commit a9a9355
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/core/server/saved_objects/migrationsv2/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,9 @@ export const createInitialState = ({
migrationVersionPerType: SavedObjectsMigrationVersion;
indexPrefix: string;
}): InitState => {
// Convert the kibanaVersion to lower case so that it's valid for using in an
// index name. This is necessary for pre-release builds like `8.0.0-SNAPSHOT`
const kibanaVersionLc = kibanaVersion.toLowerCase();
const outdatedDocumentsQuery = {
bool: {
should: Object.entries(migrationVersionPerType).map(([type, latestVersion]) => ({
Expand Down Expand Up @@ -736,10 +739,10 @@ export const createInitialState = ({
indexPrefix,
legacyIndex: indexPrefix,
currentAlias: indexPrefix,
versionAlias: `${indexPrefix}_${kibanaVersion}`,
versionIndex: `${indexPrefix}_${kibanaVersion}_001`,
tempIndex: `${indexPrefix}_${kibanaVersion}_reindex_temp`,
kibanaVersion,
versionAlias: `${indexPrefix}_${kibanaVersionLc}`,
versionIndex: `${indexPrefix}_${kibanaVersionLc}_001`,
tempIndex: `${indexPrefix}_${kibanaVersionLc}_reindex_temp`,
kibanaVersion: kibanaVersionLc,
preMigrationScript: Option.fromNullable(preMigrationScript),
targetIndexMappings: targetMappings,
tempIndexMappings: reindexTargetMappings,
Expand Down

0 comments on commit a9a9355

Please sign in to comment.