Skip to content
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
1 change: 1 addition & 0 deletions src/cli/cluster/cluster_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports = class ClusterManager {
const serverArgv = [];
const optimizerArgv = [
'--plugins.initialize=false',
'--uiSettings.enabled=false',
'--server.autoListen=false',
];

Expand Down
10 changes: 9 additions & 1 deletion src/server/config/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ module.exports = () => Joi.object({
reuseTiles: Joi.boolean(),
bounds: Joi.array().items(Joi.array().items(Joi.number()).min(2).required()).min(2)
}).default()
}).default()
}).default(),

uiSettings: Joi.object({
// this is used to prevent the uiSettings from initializing. Since they
// require the elasticsearch plugin in order to function we need to turn
// them off when we turn off the elasticsearch plugin (like we do in the
// optimizer half of the dev server)
enabled: Joi.boolean().default(true)
}).default(),

}).default();
1 change: 1 addition & 0 deletions src/ui/settings/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ function instantiate({ getResult } = {}) {
const configGet = sinon.stub();
configGet.withArgs('kibana.index').returns('.kibana');
configGet.withArgs('pkg.version').returns('1.2.3-test');
configGet.withArgs('uiSettings.enabled').returns(true);
const config = {
get: configGet
};
Expand Down
11 changes: 11 additions & 0 deletions src/ui/settings/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import defaultsProvider from './defaults';

export default function setupSettings(kbnServer, server, config) {
const status = kbnServer.status.create('ui settings');

if (!config.get('uiSettings.enabled')) {
status.disabled('uiSettings.enabled config is set to `false`');
return;
}

const uiSettings = {
// returns a Promise for the value of the requested setting
get,
Expand Down Expand Up @@ -99,6 +105,11 @@ export default function setupSettings(kbnServer, server, config) {
function mirrorEsStatus() {
const esStatus = kbnServer.status.getForPluginId('elasticsearch');

if (!esStatus) {
status.red('UI Settings requires the elasticsearch plugin');
return;
}

copyStatus();
esStatus.on('change', copyStatus);

Expand Down