Skip to content

Commit

Permalink
Code feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
igoristic committed Jul 6, 2020
1 parent 84628e5 commit 78cd7c4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions x-pack/plugins/monitoring/server/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ export const deprecations = ({
),
renameFromRoot('xpack.monitoring', 'monitoring'),
(config, fromPath, logger) => {
const clusterAlertsEnabled = get(config, 'cluster_alerts.enabled');
const clusterAlertsEnabled = get(config, 'monitoring.cluster_alerts.enabled', true);
const emailNotificationsEnabled =
clusterAlertsEnabled && get(config, 'cluster_alerts.email_notifications.enabled');
if (emailNotificationsEnabled && !get(config, CLUSTER_ALERTS_ADDRESS_CONFIG_KEY)) {
clusterAlertsEnabled &&
get(config, 'monitoring.cluster_alerts.email_notifications.enabled', true);
const updatedKey = get(config, `monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`);
const legacyKey = get(config, `xpack.monitoring.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}`);
if (emailNotificationsEnabled && !updatedKey && !legacyKey) {
logger(
`Config key [${fromPath}.${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}] will be required for email notifications to work in 7.0."`
);
Expand Down

0 comments on commit 78cd7c4

Please sign in to comment.