From 777ebbce5a7403146c43ac620774b5c56c36b05d Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Tue, 14 Jun 2016 16:13:03 -0700 Subject: [PATCH] Setting Elasticsearch plugin to yellow instead of Kibana plugin The Elasticsearch plugin is what is responsible for (re)creating the Kibana index. So it makes sense that if we couldn't find the user settings in that index, we set the Elasticsearch plugin to yellow. Once it recreates the Kibana index, it will set itself to green. No need to toggle the states of the Kibana plugin at all. --- src/ui/settings/index.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/ui/settings/index.js b/src/ui/settings/index.js index 3049a31f8784e..7ee9ef504e1a6 100644 --- a/src/ui/settings/index.js +++ b/src/ui/settings/index.js @@ -24,26 +24,16 @@ export default function setupSettings(kbnServer, server, config) { } function userSettingsNotFound(kibanaVersion) { - server.plugins.kibana.status.yellow(`Could not find user-provided settings for this version of Kibana (${kibanaVersion})`); + server.plugins.elasticsearch.status.yellow(`Could not find user-provided settings for this version of Kibana (${kibanaVersion})`); return {}; } - function resetKibanaPluginStatusIfNecessary(user) { - const isElasticsearchPluginGreen = server.plugins.elasticsearch.status.state === 'green'; - const isKibanaPluginCurrentlyYellow = server.plugins.kibana.status.state === 'yellow'; - if (isElasticsearchPluginGreen && isKibanaPluginCurrentlyYellow) { - server.plugins.kibana.status.green('Ready'); - } - return user; - } - function getUserProvided() { const { client } = server.plugins.elasticsearch; const clientSettings = getClientSettings(config); return client .get({ ...clientSettings }) .then(res => res._source) - .then(resetKibanaPluginStatusIfNecessary) .catch(partial(userSettingsNotFound, clientSettings.id)) .then(user => hydrateUserSettings(user)); }