2018-04-20 21:13:37 +02:00
|
|
|
/*
|
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License;
|
|
|
|
* you may not use this file except in compliance with the Elastic License.
|
|
|
|
*/
|
|
|
|
|
2019-02-05 04:37:32 +01:00
|
|
|
import { get } from 'lodash';
|
2018-09-06 16:26:05 +02:00
|
|
|
import { CLUSTER_ALERTS_ADDRESS_CONFIG_KEY } from './common/constants';
|
2018-04-20 21:13:37 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Re-writes deprecated user-defined config settings and logs warnings as a
|
|
|
|
* result of any rewrite operations.
|
|
|
|
*
|
|
|
|
* Important: Do not remove any deprecation warning until at least the next
|
|
|
|
* major version!
|
|
|
|
* @return {Array} array of rename operations and callback function for rename logging
|
|
|
|
*/
|
2019-01-30 16:21:06 +01:00
|
|
|
export const deprecations = () => {
|
2018-04-20 21:13:37 +02:00
|
|
|
return [
|
2018-09-06 16:26:05 +02:00
|
|
|
(settings, log) => {
|
|
|
|
const clusterAlertsEnabled = get(settings, 'cluster_alerts.enabled');
|
|
|
|
const emailNotificationsEnabled = clusterAlertsEnabled && get(settings, 'cluster_alerts.email_notifications.enabled');
|
|
|
|
if (emailNotificationsEnabled && !get(settings, CLUSTER_ALERTS_ADDRESS_CONFIG_KEY)) {
|
|
|
|
log(`Config key "${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}" will be required for email notifications to work in 7.0."`);
|
2018-04-20 21:13:37 +02:00
|
|
|
}
|
2018-12-18 20:22:43 +01:00
|
|
|
}
|
2018-04-20 21:13:37 +02:00
|
|
|
];
|
|
|
|
};
|