mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Debug log the latest saved object migrations per type (#89722)
* Debug log the latest saved object migrations per type * Fix broken test
This commit is contained in:
parent
69f4c9d541
commit
7fbec26594
2 changed files with 12 additions and 2 deletions
|
@ -119,8 +119,8 @@ describe('KibanaMigrator', () => {
|
|||
|
||||
const migrator = new KibanaMigrator(options);
|
||||
|
||||
expect(() => migrator.runMigrations()).rejects.toThrow(
|
||||
/Migrations are not ready. Make sure prepareMigrations is called first./i
|
||||
await expect(() => migrator.runMigrations()).toThrowErrorMatchingInlineSnapshot(
|
||||
`"Migrations are not ready. Make sure prepareMigrations is called first."`
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import Semver from 'semver';
|
||||
import { KibanaConfigType } from '../../../kibana_config';
|
||||
import { ElasticsearchClient } from '../../../elasticsearch';
|
||||
import { Logger } from '../../../logging';
|
||||
|
@ -163,6 +164,15 @@ export class KibanaMigrator {
|
|||
registry: this.typeRegistry,
|
||||
});
|
||||
|
||||
this.log.debug('Applying registered migrations for the following saved object types:');
|
||||
Object.entries(this.documentMigrator.migrationVersion)
|
||||
.sort(([t1, v1], [t2, v2]) => {
|
||||
return Semver.compare(v1, v2);
|
||||
})
|
||||
.forEach(([type, migrationVersion]) => {
|
||||
this.log.debug(`migrationVersion: ${migrationVersion} saved object type: ${type}`);
|
||||
});
|
||||
|
||||
const migrators = Object.keys(indexMap).map((index) => {
|
||||
// TODO migrationsV2: remove old migrations algorithm
|
||||
if (this.savedObjectsConfig.enableV2) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue