mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -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
6b4c015530
commit
8ab515243c
1 changed files with 11 additions and 5 deletions
|
@ -61,7 +61,7 @@ export function getSettingsCollector(server, kbnServer) {
|
|||
return collectorSet.makeStatsCollector({
|
||||
type: KIBANA_SETTINGS_TYPE,
|
||||
async fetch(callCluster) {
|
||||
let kibanaSettingsData;
|
||||
let kibanaSettingsData = null;
|
||||
const defaultAdminEmail = await checkForEmailValue(config, callCluster);
|
||||
|
||||
// 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
|
||||
shouldUseNull = !!defaultAdminEmail;
|
||||
|
||||
return {
|
||||
kibana: getKibanaInfoForStats(server, kbnServer),
|
||||
...kibanaSettingsData
|
||||
};
|
||||
// return nothing when there was no result
|
||||
let settingsDoc;
|
||||
if (kibanaSettingsData !== null) {
|
||||
settingsDoc = {
|
||||
kibana: getKibanaInfoForStats(server, kbnServer),
|
||||
...kibanaSettingsData
|
||||
};
|
||||
}
|
||||
|
||||
return settingsDoc;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue