diff --git a/x-pack/legacy/plugins/telemetry/index.ts b/x-pack/legacy/plugins/telemetry/index.ts index 4125dae82f9fa..b1f5a953ab1d3 100644 --- a/x-pack/legacy/plugins/telemetry/index.ts +++ b/x-pack/legacy/plugins/telemetry/index.ts @@ -64,12 +64,9 @@ export const telemetry = (kibana: any) => { injectDefaultVars(server: Server) { const config = server.config(); return { - telemetryEnabled: getXpackConfigWithDeprecated(config, 'telemetry.enabled'), telemetryUrl: getXpackConfigWithDeprecated(config, 'telemetry.url'), - spacesEnabled: config.get('xpack.spaces.enabled'), telemetryBanner: config.get('xpack.telemetry.banner'), telemetryOptedIn: null, - activeSpace: null, }; }, hacks: [ diff --git a/x-pack/legacy/plugins/xpack_main/index.js b/x-pack/legacy/plugins/xpack_main/index.js index 14be51bc871e6..4feb69f62cd19 100644 --- a/x-pack/legacy/plugins/xpack_main/index.js +++ b/x-pack/legacy/plugins/xpack_main/index.js @@ -10,6 +10,7 @@ import { XPACK_DEFAULT_ADMIN_EMAIL_UI_SETTING, XPACK_INFO_API_DEFAULT_POLL_FREQUENCY_IN_MILLIS } from '../../server/lib/constants'; +import { getXpackConfigWithDeprecated } from '../telemetry/common/get_xpack_config_with_deprecated'; import { mirrorPluginStatus } from '../../server/lib/mirror_plugin_status'; import { replaceInjectedVars } from './server/lib/replace_injected_vars'; import { setupXPackMain } from './server/lib/setup_xpack_main'; @@ -75,6 +76,15 @@ export const xpackMain = (kibana) => { 'plugins/xpack_main/hacks/check_xpack_info_change', ], replaceInjectedVars, + injectDefaultVars(server) { + const config = server.config(); + + return { + telemetryEnabled: getXpackConfigWithDeprecated(config, 'telemetry.enabled'), + activeSpace: null, + spacesEnabled: config.get('xpack.spaces.enabled'), + }; + }, __webpackPluginProvider__(webpack) { return new webpack.BannerPlugin({ banner: dedent`