---------

**Commit 1:**
UI Settings disabled when plugins.initialize is false

* Original sha: c6f90e2fd3
* Authored by = <brandon.kobel@elastic.co> on 2016-10-19T20:47:05Z

**Commit 2:**
Moving where we're disabling the ui settings

* Original sha: e66c7e79f9
* Authored by = <brandon.kobel@elastic.co> on 2016-10-19T21:22:52Z

**Commit 3:**
[server/uiSettings] add enabled config

in response to matt's comment that relying on `plugins.initialize` is kinda dirty (with which we all agree) we're adding an undocumented config value that the dev cli can use to put prevent the optimizr server from logging meaningless warnings

* Original sha: 40ffd12238
* Authored by spalger <email@spalger.com> on 2016-10-19T23:24:55Z

**Commit 4:**
[server/uiSettings] react to missing elasticsearch plugin

* Original sha: 7feacf6a70
* Authored by spalger <email@spalger.com> on 2016-10-19T23:26:44Z

**Commit 5:**
[server/uiSettings] fix da tests

* Original sha: c2d7d0136a
* Authored by spalger <email@spalger.com> on 2016-10-19T23:36:11Z

**Commit 6:**
[server/uiSettings] document enabled config

* Original sha: f9bd154fcd
* Authored by Spencer <spalger@users.noreply.github.com> on 2016-10-19T23:52:28Z
* Committed by GitHub <noreply@github.com> on 2016-10-19T23:52:28Z
This commit is contained in:
Elastic Jasper 2016-10-19 19:52:59 -04:00
parent 5e1ac9d66e
commit d4f4381f33
4 changed files with 22 additions and 1 deletions

View file

@ -18,6 +18,7 @@ module.exports = class ClusterManager {
const serverArgv = [];
const optimizerArgv = [
'--plugins.initialize=false',
'--uiSettings.enabled=false',
'--server.autoListen=false',
];

View file

@ -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();

View file

@ -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
};

View file

@ -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,
@ -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);