Skip to content

Commit

Permalink
Add deprecation levels (#115832)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisronline authored Oct 21, 2021
1 parent 21878b5 commit ce54699
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion x-pack/plugins/actions/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export const plugin = (initContext: PluginInitializerContext) => new ActionsPlug
export const config: PluginConfigDescriptor<ActionsConfig> = {
schema: configSchema,
deprecations: ({ renameFromRoot, unused }) => [
renameFromRoot('xpack.actions.whitelistedHosts', 'xpack.actions.allowedHosts'),
renameFromRoot('xpack.actions.whitelistedHosts', 'xpack.actions.allowedHosts', {
level: 'warning',
}),
(settings, fromPath, addDeprecation) => {
const actions = get(settings, fromPath);
const customHostSettings = actions?.customHostSettings ?? [];
Expand All @@ -69,6 +71,7 @@ export const config: PluginConfigDescriptor<ActionsConfig> = {
)
) {
addDeprecation({
level: 'warning',
configPath: 'xpack.actions.customHostSettings.ssl.rejectUnauthorized',
message:
`"xpack.actions.customHostSettings[<index>].ssl.rejectUnauthorized" is deprecated.` +
Expand Down Expand Up @@ -97,6 +100,7 @@ export const config: PluginConfigDescriptor<ActionsConfig> = {
const actions = get(settings, fromPath);
if (actions?.hasOwnProperty('rejectUnauthorized')) {
addDeprecation({
level: 'warning',
configPath: `${fromPath}.rejectUnauthorized`,
message:
`"xpack.actions.rejectUnauthorized" is deprecated. Use "xpack.actions.verificationMode" instead, ` +
Expand Down Expand Up @@ -124,6 +128,7 @@ export const config: PluginConfigDescriptor<ActionsConfig> = {
const actions = get(settings, fromPath);
if (actions?.hasOwnProperty('proxyRejectUnauthorizedCertificates')) {
addDeprecation({
level: 'warning',
configPath: `${fromPath}.proxyRejectUnauthorizedCertificates`,
message:
`"xpack.actions.proxyRejectUnauthorizedCertificates" is deprecated. Use "xpack.actions.proxyVerificationMode" instead, ` +
Expand Down
8 changes: 5 additions & 3 deletions x-pack/plugins/alerting/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,16 @@ export const plugin = (initContext: PluginInitializerContext) => new AlertingPlu
export const config: PluginConfigDescriptor<AlertsConfigType> = {
schema: configSchema,
deprecations: ({ renameFromRoot }) => [
renameFromRoot('xpack.alerts.healthCheck', 'xpack.alerting.healthCheck'),
renameFromRoot('xpack.alerts.healthCheck', 'xpack.alerting.healthCheck', { level: 'warning' }),
renameFromRoot(
'xpack.alerts.invalidateApiKeysTask.interval',
'xpack.alerting.invalidateApiKeysTask.interval'
'xpack.alerting.invalidateApiKeysTask.interval',
{ level: 'warning' }
),
renameFromRoot(
'xpack.alerts.invalidateApiKeysTask.removalDelay',
'xpack.alerting.invalidateApiKeysTask.removalDelay'
'xpack.alerting.invalidateApiKeysTask.removalDelay',
{ level: 'warning' }
),
],
};
1 change: 1 addition & 0 deletions x-pack/plugins/stack_alerts/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const config: PluginConfigDescriptor<Config> = {
const stackAlerts = get(settings, fromPath);
if (stackAlerts?.enabled === false || stackAlerts?.enabled === true) {
addDeprecation({
level: 'critical',
configPath: 'xpack.stack_alerts.enabled',
message: `"xpack.stack_alerts.enabled" is deprecated. The ability to disable this plugin will be removed in 8.0.0.`,
correctiveActions: {
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/task_manager/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const config: PluginConfigDescriptor<TaskManagerConfig> = {
const taskManager = get(settings, fromPath);
if (taskManager?.index) {
addDeprecation({
level: 'critical',
configPath: `${fromPath}.index`,
documentationUrl: 'https://ela.st/kbn-remove-legacy-multitenancy',
message: `"${fromPath}.index" is deprecated. Multitenancy by changing "kibana.index" will not be supported starting in 8.0. See https://ela.st/kbn-remove-legacy-multitenancy for more details`,
Expand All @@ -62,6 +63,7 @@ export const config: PluginConfigDescriptor<TaskManagerConfig> = {
}
if (taskManager?.max_workers > MAX_WORKERS_LIMIT) {
addDeprecation({
level: 'critical',
configPath: `${fromPath}.max_workers`,
message: `setting "${fromPath}.max_workers" (${taskManager?.max_workers}) greater than ${MAX_WORKERS_LIMIT} is deprecated. Values greater than ${MAX_WORKERS_LIMIT} will not be supported starting in 8.0.`,
correctiveActions: {
Expand Down

0 comments on commit ce54699

Please sign in to comment.