Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Code] change back to codeNode #29073

Merged
merged 1 commit into from
Jan 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion x-pack/plugins/code/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const code = (kibana: any) =>
},
config(Joi: any) {
return Joi.object({
enabled: Joi.boolean().default(false),
enabled: Joi.boolean().default(true),
queueIndex: Joi.string().default('.code-worker-queue'),
// 1 hour by default.
queueTimeout: Joi.number().default(moment.duration(1, 'hour').asMilliseconds()),
Expand All @@ -47,6 +47,7 @@ export const code = (kibana: any) =>
isAdmin: Joi.boolean().default(true), // If we show the admin buttons
disableScheduler: Joi.boolean().default(true), // Temp option to disable all schedulers.
enableGlobalReference: Joi.boolean().default(false), // Global reference as optional feature for now
codeNode: Joi.boolean().default(false),
}).default();
},
init,
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/code/server/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function retryUntilAvailable<T>(
if (value) {
return value;
} else {
return new Promise<T>(resolve => {
const promise = new Promise<T>(resolve => {
const retry = () => {
func().then(v => {
if (v) {
Expand All @@ -57,6 +57,7 @@ async function retryUntilAvailable<T>(
};
setTimeout(retry, intervalMs);
});
return await promise;
}
}

Expand All @@ -77,7 +78,7 @@ export function init(server: Server, options: any) {
enableSecurity(server);
// enable cluster status routes
clusterRoute(server, codeNodeClient, log);
if (serverOptions.enabled) {
if (serverOptions.codeNode) {
let info = await codeNodeClient.getCodeNodeInfo();
if (!info) {
let url: string = server.info.uri;
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/code/server/server_options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@ export class ServerOptions {

public readonly enabled: boolean = this.options.enabled;

public readonly codeNode: boolean = this.options.codeNode;

constructor(private options: any, private config: any) {}
}
2 changes: 1 addition & 1 deletion x-pack/test/functional/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ export default async function ({ readConfigFile }) {
'--server.uuid=5b2de169-2785-441b-ae8c-186a1936b17d',
'--xpack.xpack_main.telemetry.enabled=false',
'--xpack.security.encryptionKey="wuGNaIhoMpk5sO4UBxgr3NyW1sFcLgIf"', // server restarts should not invalidate active sessions
'--xpack.code.enabled="true"',
'--xpack.code.codeNode="true"',
],
},
uiSettings: {
Expand Down