mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
* Fix kibana_settings collector to return nothing when no settings data is found * make code more clear
This commit is contained in:
parent
0c2120a937
commit
07559c1e10
1 changed files with 11 additions and 5 deletions
|
@ -61,7 +61,7 @@ export function getSettingsCollector(server, kbnServer) {
|
||||||
return collectorSet.makeStatsCollector({
|
return collectorSet.makeStatsCollector({
|
||||||
type: KIBANA_SETTINGS_TYPE,
|
type: KIBANA_SETTINGS_TYPE,
|
||||||
async fetch(callCluster) {
|
async fetch(callCluster) {
|
||||||
let kibanaSettingsData;
|
let kibanaSettingsData = null;
|
||||||
const defaultAdminEmail = await checkForEmailValue(config, callCluster);
|
const defaultAdminEmail = await checkForEmailValue(config, callCluster);
|
||||||
|
|
||||||
// skip everything if defaultAdminEmail === undefined
|
// skip everything if defaultAdminEmail === undefined
|
||||||
|
@ -79,10 +79,16 @@ export function getSettingsCollector(server, kbnServer) {
|
||||||
// remember the current email so that we can mark it as successful if the bulk does not error out
|
// remember the current email so that we can mark it as successful if the bulk does not error out
|
||||||
shouldUseNull = !!defaultAdminEmail;
|
shouldUseNull = !!defaultAdminEmail;
|
||||||
|
|
||||||
return {
|
// return nothing when there was no result
|
||||||
kibana: getKibanaInfoForStats(server, kbnServer),
|
let settingsDoc;
|
||||||
...kibanaSettingsData
|
if (kibanaSettingsData !== null) {
|
||||||
};
|
settingsDoc = {
|
||||||
|
kibana: getKibanaInfoForStats(server, kbnServer),
|
||||||
|
...kibanaSettingsData
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return settingsDoc;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue