Skip to content

Commit

Permalink
fix x-pack tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bamieh committed May 31, 2021
1 parent 2e98cd5 commit 9e0d661
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/plugin_functional/test_suites/core/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
message:
'Kibana plugin functional tests will no longer allow corePluginDeprecations.secret config to be set to anything except 42.',
correctiveActions: {
manualSteps: ['Step a', 'Step b'],
manualSteps: [
'This is an intentional deprecation for testing with no intention for having it fixed!',
],
},
documentationUrl: 'config-secret-doc-url',
deprecationType: 'config',
Expand Down
46 changes: 46 additions & 0 deletions x-pack/plugins/monitoring/server/deprecations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,52 @@ export const deprecations = ({
}
return config;
},
(config, fromPath, addDeprecation) => {
const es: Record<string, any> = get(config, 'elasticsearch');
if (es) {
if (es.username === 'elastic') {
addDeprecation({
message: `Setting [${fromPath}.username] to "elastic" is deprecated. You should use the "kibana_system" user instead.`,
correctiveActions: {
manualSteps: [`Replace [${fromPath}.username] from "elastic" to "kibana_system".`],
},
});
} else if (es.username === 'kibana') {
addDeprecation({
message: `Setting [${fromPath}.username] to "kibana" is deprecated. You should use the "kibana_system" user instead.`,
correctiveActions: {
manualSteps: [`Replace [${fromPath}.username] from "kibana" to "kibana_system".`],
},
});
}
}
return config;
},
(config, fromPath, addDeprecation) => {
const ssl: Record<string, any> = get(config, 'elasticsearch.ssl');
if (ssl) {
if (ssl.key !== undefined && ssl.certificate === undefined) {
addDeprecation({
message: `Setting [${fromPath}.key] without [${fromPath}.certificate] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`,
correctiveActions: {
manualSteps: [
`Set [${fromPath}.ssl.certificate] in your kibana configs to enable TLS client authentication to Elasticsearch.`,
],
},
});
} else if (ssl.certificate !== undefined && ssl.key === undefined) {
addDeprecation({
message: `Setting [${fromPath}.certificate] without [${fromPath}.key] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`,
correctiveActions: {
manualSteps: [
`Set [${fromPath}.ssl.key] in your kibana configs to enable TLS client authentication to Elasticsearch.`,
],
},
});
}
}
return config;
},
rename('xpack_api_polling_frequency_millis', 'licensing.api_polling_frequency'),
];
};
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Overview page', () => {

const kibanaDeprecationsMockResponse: DomainDeprecationDetails[] = [
{
correctiveActions: {},
correctiveActions: { manualSteps: ['test-step'] },
domainId: 'xpack.spaces',
level: 'critical',
message:
Expand Down

0 comments on commit 9e0d661

Please sign in to comment.