Skip to content

Commit

Permalink
Merge branch 'master' into dev/fix-updating-deleting-sessions-from-no…
Browse files Browse the repository at this point in the history
…n-default-space
  • Loading branch information
kibanamachine committed Apr 4, 2021
2 parents 426d560 + 7d0920b commit b2002cb
Show file tree
Hide file tree
Showing 129 changed files with 2,582 additions and 618 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Expand Up @@ -1180,7 +1180,7 @@ module.exports = {
pathGroups: [
{
pattern:
'{../../../../../../,../../../../../,../../../../,../../../,../../,../}{common/,*}__mocks__{*,/**}',
'{../../../../../../,../../../../../,../../../../,../../../,../../,../,./}{common/,*}__mocks__{*,/**}',
group: 'unknown',
},
{
Expand Down
8 changes: 5 additions & 3 deletions docs/setup/docker.asciidoc
Expand Up @@ -39,11 +39,13 @@ docker pull {docker-repo}:{version}
=== Run Kibana on Docker for development
Kibana can be quickly started and connected to a local Elasticsearch container for development
or testing use with the following command:
--------------------------------------------

[source,sh,subs="attributes"]
----
docker run --link YOUR_ELASTICSEARCH_CONTAINER_NAME_OR_ID:elasticsearch -p 5601:5601 {docker-repo}:{version}
--------------------------------------------
endif::[]
----

endif::[]
[float]
[[configuring-kibana-docker]]
=== Configure Kibana on Docker
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -97,7 +97,7 @@
"dependencies": {
"@elastic/apm-rum": "^5.6.1",
"@elastic/apm-rum-react": "^1.2.5",
"@elastic/charts": "26.1.0",
"@elastic/charts": "27.0.0",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4",
"@elastic/ems-client": "7.12.0",
Expand Down
Expand Up @@ -35,13 +35,14 @@ const createMigrator = (
) => {
const mockMigrator: jest.Mocked<IKibanaMigrator> = {
kibanaVersion: '8.0.0-testing',
savedObjectsConfig: {
soMigrationsConfig: {
batchSize: 100,
scrollDuration: '15m',
pollInterval: 1500,
skip: false,
// TODO migrationsV2: remove/deprecate once we release migrations v2
// TODO migrationsV2: remove/deprecate once we remove migrations v1
enableV2: false,
retryAttempts: 10,
},
runMigrations: jest.fn(),
getActiveMappings: jest.fn(),
Expand Down
Expand Up @@ -414,12 +414,13 @@ const mockOptions = ({ enableV2 }: { enableV2: boolean } = { enableV2: false })
enabled: true,
index: '.my-index',
} as KibanaMigratorOptions['kibanaConfig'],
savedObjectsConfig: {
soMigrationsConfig: {
batchSize: 20,
pollInterval: 20000,
scrollDuration: '10m',
skip: false,
enableV2,
retryAttempts: 20,
},
client: elasticsearchClientMock.createElasticsearchClient(),
};
Expand Down
23 changes: 12 additions & 11 deletions src/core/server/saved_objects/migrations/kibana/kibana_migrator.ts
Expand Up @@ -41,7 +41,7 @@ import { MigrationLogger } from '../core/migration_logger';
export interface KibanaMigratorOptions {
client: ElasticsearchClient;
typeRegistry: ISavedObjectTypeRegistry;
savedObjectsConfig: SavedObjectsMigrationConfigType;
soMigrationsConfig: SavedObjectsMigrationConfigType;
kibanaConfig: KibanaConfigType;
kibanaVersion: string;
logger: Logger;
Expand Down Expand Up @@ -72,10 +72,10 @@ export class KibanaMigrator {
});
private readonly activeMappings: IndexMapping;
private migrationsRetryDelay?: number;
// TODO migrationsV2: make private once we release migrations v2
public kibanaVersion: string;
// TODO migrationsV2: make private once we release migrations v2
public readonly savedObjectsConfig: SavedObjectsMigrationConfigType;
// TODO migrationsV2: make private once we remove migrations v1
public readonly kibanaVersion: string;
// TODO migrationsV2: make private once we remove migrations v1
public readonly soMigrationsConfig: SavedObjectsMigrationConfigType;

/**
* Creates an instance of KibanaMigrator.
Expand All @@ -84,14 +84,14 @@ export class KibanaMigrator {
client,
typeRegistry,
kibanaConfig,
savedObjectsConfig,
soMigrationsConfig,
kibanaVersion,
logger,
migrationsRetryDelay,
}: KibanaMigratorOptions) {
this.client = client;
this.kibanaConfig = kibanaConfig;
this.savedObjectsConfig = savedObjectsConfig;
this.soMigrationsConfig = soMigrationsConfig;
this.typeRegistry = typeRegistry;
this.serializer = new SavedObjectsSerializer(this.typeRegistry);
this.mappingProperties = mergeTypes(this.typeRegistry.getAllTypes());
Expand Down Expand Up @@ -175,7 +175,7 @@ export class KibanaMigrator {

const migrators = Object.keys(indexMap).map((index) => {
// TODO migrationsV2: remove old migrations algorithm
if (this.savedObjectsConfig.enableV2) {
if (this.soMigrationsConfig.enableV2) {
return {
migrate: (): Promise<MigrationResult> => {
return runResilientMigrator({
Expand All @@ -193,20 +193,21 @@ export class KibanaMigrator {
),
migrationVersionPerType: this.documentMigrator.migrationVersion,
indexPrefix: index,
migrationsConfig: this.soMigrationsConfig,
});
},
};
} else {
return new IndexMigrator({
batchSize: this.savedObjectsConfig.batchSize,
batchSize: this.soMigrationsConfig.batchSize,
client: createMigrationEsClient(this.client, this.log, this.migrationsRetryDelay),
documentMigrator: this.documentMigrator,
index,
kibanaVersion: this.kibanaVersion,
log: this.log,
mappingProperties: indexMap[index].typeMappings,
pollInterval: this.savedObjectsConfig.pollInterval,
scrollDuration: this.savedObjectsConfig.scrollDuration,
pollInterval: this.soMigrationsConfig.pollInterval,
scrollDuration: this.soMigrationsConfig.scrollDuration,
serializer: this.serializer,
// Only necessary for the migrator of the kibana index.
obsoleteIndexTemplatePattern:
Expand Down

0 comments on commit b2002cb

Please sign in to comment.