Skip to content

ClusterManager is created with incorrect parameters #52860

@pgayvallet

Description

@pgayvallet

In the LegacyService, we are creating the cluster manager by passing the actual legacy configuration

require('../../../cli/cluster/cluster_manager').create(
this.coreContext.env.cliArgs,
config,
await basePathProxy$.toPromise()
);

However the function actually expects the raw settings instead

export default class ClusterManager {
static create(opts, settings = {}, basePathProxy) {
return new ClusterManager(
opts,
Config.withDefaultSchema(settings),
basePathProxy
);
}

From #52251 (comment):

The fix is (well, should be) easy

require('../../../cli/cluster/cluster_manager').create(
      this.coreContext.env.cliArgs,
--    config,
++    config.get(),
      await basePathProxy$.toPromise()
    );

However the legacy service tests are a mess, and are not properly mocking with correct object types (the config in test is actually a Record and not a LegacyConfig ). Already had to fix that in #52060, so would be easier to fix in a separate PR once it lands.

Metadata

Metadata

Assignees

Labels

Feature:New PlatformTeam:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//bugFixes for quality problems that affect the customer experience

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions