mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Merge pull request #7333 from ycombinator/gh-7318
If user settings cannot be found for installed version of Kibana, turn Kibana plugin red
This commit is contained in:
commit
6e46c0e798
1 changed files with 8 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
import { defaultsDeep } from 'lodash';
|
||||
import { defaultsDeep, partial } from 'lodash';
|
||||
import defaultsProvider from './defaults';
|
||||
|
||||
export default function setupSettings(kbnServer, server, config) {
|
||||
|
@ -23,12 +23,19 @@ export default function setupSettings(kbnServer, server, config) {
|
|||
return Promise.resolve(defaultsProvider());
|
||||
}
|
||||
|
||||
function userSettingsNotFound(kibanaVersion) {
|
||||
const message = 'Could not find user-provided settings for this version of Kibana (' + kibanaVersion + ')';
|
||||
server.plugins.kibana.status.red(message);
|
||||
return {};
|
||||
}
|
||||
|
||||
function getUserProvided() {
|
||||
const { client } = server.plugins.elasticsearch;
|
||||
const clientSettings = getClientSettings(config);
|
||||
return client
|
||||
.get({ ...clientSettings })
|
||||
.then(res => res._source)
|
||||
.catch(partial(userSettingsNotFound, clientSettings.id))
|
||||
.then(user => hydrateUserSettings(user));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue