-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate
xpack.task_manager.index
setting (#84155)
* Deprecate `xpack.task_manager.index` setting * Updating developer docs about configuring task manager settings
- Loading branch information
Showing
3 changed files
with
59 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
import { config } from './index'; | ||
import { applyDeprecations, configDeprecationFactory } from '@kbn/config'; | ||
|
||
const CONFIG_PATH = 'xpack.task_manager'; | ||
|
||
const applyTaskManagerDeprecations = (settings: Record<string, unknown> = {}) => { | ||
const deprecations = config.deprecations!(configDeprecationFactory); | ||
const deprecationMessages: string[] = []; | ||
const _config = { | ||
[CONFIG_PATH]: settings, | ||
}; | ||
const migrated = applyDeprecations( | ||
_config, | ||
deprecations.map((deprecation) => ({ | ||
deprecation, | ||
path: CONFIG_PATH, | ||
})), | ||
(msg) => deprecationMessages.push(msg) | ||
); | ||
return { | ||
messages: deprecationMessages, | ||
migrated, | ||
}; | ||
}; | ||
|
||
describe('deprecations', () => { | ||
['.foo', '.kibana_task_manager'].forEach((index) => { | ||
it('logs a warning if index is set', () => { | ||
const { messages } = applyTaskManagerDeprecations({ index }); | ||
expect(messages).toMatchInlineSnapshot(` | ||
Array [ | ||
"\\"xpack.task_manager.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", | ||
] | ||
`); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters