Skip to content

Commit

Permalink
[Non-Inclusive Language] Replace isDevClusterMaster with isDevCluster…
Browse files Browse the repository at this point in the history
…Manager

Signed-off-by: manasvis <manasvis@amazon.com>
  • Loading branch information
manasvinibs committed Jun 13, 2022
1 parent 3ff99cf commit 3b9461b
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions packages/osd-config/src/__mocks__/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function getEnvOptions(options: DeepPartial<EnvOptions> = {}): EnvOptions
runExamples: false,
...(options.cliArgs || {}),
},
isDevClusterMaster:
options.isDevClusterMaster !== undefined ? options.isDevClusterMaster : false,
isDevClusterManager:
options.isDevClusterManager !== undefined ? options.isDevClusterManager : false,
};
}
12 changes: 6 additions & 6 deletions packages/osd-config/src/__snapshots__/env.test.ts.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/osd-config/src/env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test('correctly creates default environment in dev mode.', () => {
REPO_ROOT,
getEnvOptions({
configs: ['/test/cwd/config/opensearch_dashboards.yml'],
isDevClusterMaster: true,
isDevClusterManager: true,
})
);

Expand Down
6 changes: 3 additions & 3 deletions packages/osd-config/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { PackageInfo, EnvironmentMode } from './types';
export interface EnvOptions {
configs: string[];
cliArgs: CliArgs;
isDevClusterMaster: boolean;
isDevClusterManager: boolean;
}

/** @internal */
Expand Down Expand Up @@ -113,7 +113,7 @@ export class Env {
* Indicates that this OpenSearch Dashboards instance is run as development Node Cluster master.
* @internal
*/
public readonly isDevClusterMaster: boolean;
public readonly isDevClusterManager: boolean;

/**
* @internal
Expand All @@ -137,7 +137,7 @@ export class Env {

this.cliArgs = Object.freeze(options.cliArgs);
this.configs = Object.freeze(options.configs);
this.isDevClusterMaster = options.isDevClusterMaster;
this.isDevClusterManager = options.isDevClusterManager;

const isDevMode = this.cliArgs.dev || this.cliArgs.envName === 'development';
this.mode = Object.freeze<EnvironmentMode>({
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export async function bootstrap({
const env = Env.createDefault(REPO_ROOT, {
configs,
cliArgs,
isDevClusterMaster: isMaster && cliArgs.dev && features.isClusterModeSupported,
isDevClusterManager: isMaster && cliArgs.dev && features.isClusterModeSupported,
});

const rawConfigService = new RawConfigService(env.configs, applyConfigOverrides);
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/http_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ test('does not start http server if process is dev cluster master', async () =>
const service = new HttpService({
coreId,
configService,
env: Env.createDefault(REPO_ROOT, getEnvOptions({ isDevClusterMaster: true })),
env: Env.createDefault(REPO_ROOT, getEnvOptions({ isDevClusterManager: true })),
logger,
});

Expand Down
2 changes: 1 addition & 1 deletion src/core/server/http/http_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class HttpService
* @internal
* */
private shouldListen(config: HttpConfig) {
return !this.coreContext.env.isDevClusterMaster && config.autoListen;
return !this.coreContext.env.isDevClusterManager && config.autoListen;
}

public async stop() {
Expand Down
4 changes: 2 additions & 2 deletions src/core/server/legacy/legacy_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ describe('once LegacyService is set up in `devClusterMaster` mode', () => {
REPO_ROOT,
getEnvOptions({
cliArgs: { silent: true, basePath: false },
isDevClusterMaster: true,
isDevClusterManager: true,
})
),
logger,
Expand Down Expand Up @@ -402,7 +402,7 @@ describe('once LegacyService is set up in `devClusterMaster` mode', () => {
REPO_ROOT,
getEnvOptions({
cliArgs: { quiet: true, basePath: true },
isDevClusterMaster: true,
isDevClusterManager: true,
})
),
logger,
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/legacy/legacy_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export class LegacyService implements CoreService {
this.log.debug('starting legacy service');

// Receive initial config and create osdServer/ClusterManager.
if (this.coreContext.env.isDevClusterMaster) {
if (this.coreContext.env.isDevClusterManager) {
await this.createClusterManager(this.legacyRawConfig!);
} else {
this.osdServer = await this.createOsdServer(
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/plugins/plugins_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class PluginsService implements CoreService<PluginsServiceSetup, PluginsS
const config = await this.config$.pipe(first()).toPromise();

let contracts = new Map<PluginName, unknown>();
const initialize = config.initialize && !this.coreContext.env.isDevClusterMaster;
const initialize = config.initialize && !this.coreContext.env.isDevClusterManager;
if (initialize) {
contracts = await this.pluginsSystem.setupPlugins(deps);
this.registerPluginStaticDirs(deps);
Expand Down
2 changes: 1 addition & 1 deletion src/core/test_helpers/osd_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function createRootWithSettings(
dist: false,
...cliArgs,
},
isDevClusterMaster: false,
isDevClusterManager: false,
});

return new Root(
Expand Down

0 comments on commit 3b9461b

Please sign in to comment.