Skip to content

Commit

Permalink
[Monitoring] Fix monitoring 7.7 deprecations (#63738) (#64176)
Browse files Browse the repository at this point in the history
* Fix monitoring 7.7 deprecations

* Switch order

* Add comment

Co-authored-by: Elastic Machine <[email protected]>

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
chrisronline and elasticmachine authored Apr 22, 2020
1 parent 247ba30 commit 423922e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 51 deletions.
50 changes: 0 additions & 50 deletions src/core/server/config/deprecation/core_deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,56 +135,6 @@ export const coreDeprecationProvider: ConfigDeprecationProvider = ({
renameFromRoot('xpack.telemetry.config', 'telemetry.config'),
renameFromRoot('xpack.telemetry.banner', 'telemetry.banner'),
renameFromRoot('xpack.telemetry.url', 'telemetry.url'),
// Monitoring renames
// TODO: Remove these from here once the monitoring plugin is migrated to NP
renameFromRoot('xpack.monitoring.enabled', 'monitoring.enabled'),
renameFromRoot('xpack.monitoring.ui.enabled', 'monitoring.ui.enabled'),
renameFromRoot(
'xpack.monitoring.kibana.collection.enabled',
'monitoring.kibana.collection.enabled'
),
renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'),
renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'),
renameFromRoot(
'xpack.monitoring.show_license_expiration',
'monitoring.ui.show_license_expiration'
),
renameFromRoot(
'xpack.monitoring.ui.container.elasticsearch.enabled',
'monitoring.ui.container.elasticsearch.enabled'
),
renameFromRoot(
'xpack.monitoring.ui.container.logstash.enabled',
'monitoring.ui.container.logstash.enabled'
),
renameFromRoot(
'xpack.monitoring.tests.cloud_detector.enabled',
'monitoring.tests.cloud_detector.enabled'
),
renameFromRoot(
'xpack.monitoring.kibana.collection.interval',
'monitoring.kibana.collection.interval'
),
renameFromRoot('xpack.monitoring.elasticsearch.hosts', 'monitoring.ui.elasticsearch.hosts'),
renameFromRoot('xpack.monitoring.elasticsearch.username', 'monitoring.ui.elasticsearch.username'),
renameFromRoot('xpack.monitoring.elasticsearch.password', 'monitoring.ui.elasticsearch.password'),
renameFromRoot(
'xpack.monitoring.xpack_api_polling_frequency_millis',
'monitoring.xpack_api_polling_frequency_millis'
),
renameFromRoot(
'xpack.monitoring.cluster_alerts.email_notifications.enabled',
'monitoring.cluster_alerts.email_notifications.enabled'
),
renameFromRoot(
'xpack.monitoring.cluster_alerts.email_notifications.email_address',
'monitoring.cluster_alerts.email_notifications.email_address'
),
renameFromRoot('xpack.monitoring.ccs.enabled', 'monitoring.ui.ccs.enabled'),
renameFromRoot(
'xpack.monitoring.elasticsearch.logFetchCount',
'monitoring.ui.elasticsearch.logFetchCount'
),
configPathDeprecation,
dataPathDeprecation,
rewriteBasePathDeprecation,
Expand Down
27 changes: 26 additions & 1 deletion x-pack/plugins/monitoring/server/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,33 @@ import { CLUSTER_ALERTS_ADDRESS_CONFIG_KEY } from '../common/constants';
* major version!
* @return {Array} array of rename operations and callback function for rename logging
*/
export const deprecations = ({ rename }: ConfigDeprecationFactory): ConfigDeprecation[] => {
export const deprecations = ({
rename,
renameFromRoot,
}: ConfigDeprecationFactory): ConfigDeprecation[] => {
return [
// This order matters. The "blanket rename" needs to happen at the end
renameFromRoot('xpack.monitoring.max_bucket_size', 'monitoring.ui.max_bucket_size'),
renameFromRoot('xpack.monitoring.min_interval_seconds', 'monitoring.ui.min_interval_seconds'),
renameFromRoot(
'xpack.monitoring.show_license_expiration',
'monitoring.ui.show_license_expiration'
),
renameFromRoot(
'xpack.monitoring.ui.container.elasticsearch.enabled',
'monitoring.ui.container.elasticsearch.enabled'
),
renameFromRoot(
'xpack.monitoring.ui.container.logstash.enabled',
'monitoring.ui.container.logstash.enabled'
),
renameFromRoot('xpack.monitoring.elasticsearch', 'monitoring.ui.elasticsearch'),
renameFromRoot('xpack.monitoring.ccs.enabled', 'monitoring.ui.ccs.enabled'),
renameFromRoot(
'xpack.monitoring.elasticsearch.logFetchCount',
'monitoring.ui.elasticsearch.logFetchCount'
),
renameFromRoot('xpack.monitoring', 'monitoring'),
(config, fromPath, logger) => {
const clusterAlertsEnabled = get(config, 'cluster_alerts.enabled');
const emailNotificationsEnabled =
Expand Down

0 comments on commit 423922e

Please sign in to comment.