Skip to content

Commit 9e0d661

Browse files
committed
fix x-pack tests
1 parent 2e98cd5 commit 9e0d661

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

test/plugin_functional/test_suites/core/deprecations.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide
4646
message:
4747
'Kibana plugin functional tests will no longer allow corePluginDeprecations.secret config to be set to anything except 42.',
4848
correctiveActions: {
49-
manualSteps: ['Step a', 'Step b'],
49+
manualSteps: [
50+
'This is an intentional deprecation for testing with no intention for having it fixed!',
51+
],
5052
},
5153
documentationUrl: 'config-secret-doc-url',
5254
deprecationType: 'config',

x-pack/plugins/monitoring/server/deprecations.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,52 @@ export const deprecations = ({
5858
}
5959
return config;
6060
},
61+
(config, fromPath, addDeprecation) => {
62+
const es: Record<string, any> = get(config, 'elasticsearch');
63+
if (es) {
64+
if (es.username === 'elastic') {
65+
addDeprecation({
66+
message: `Setting [${fromPath}.username] to "elastic" is deprecated. You should use the "kibana_system" user instead.`,
67+
correctiveActions: {
68+
manualSteps: [`Replace [${fromPath}.username] from "elastic" to "kibana_system".`],
69+
},
70+
});
71+
} else if (es.username === 'kibana') {
72+
addDeprecation({
73+
message: `Setting [${fromPath}.username] to "kibana" is deprecated. You should use the "kibana_system" user instead.`,
74+
correctiveActions: {
75+
manualSteps: [`Replace [${fromPath}.username] from "kibana" to "kibana_system".`],
76+
},
77+
});
78+
}
79+
}
80+
return config;
81+
},
82+
(config, fromPath, addDeprecation) => {
83+
const ssl: Record<string, any> = get(config, 'elasticsearch.ssl');
84+
if (ssl) {
85+
if (ssl.key !== undefined && ssl.certificate === undefined) {
86+
addDeprecation({
87+
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.`,
88+
correctiveActions: {
89+
manualSteps: [
90+
`Set [${fromPath}.ssl.certificate] in your kibana configs to enable TLS client authentication to Elasticsearch.`,
91+
],
92+
},
93+
});
94+
} else if (ssl.certificate !== undefined && ssl.key === undefined) {
95+
addDeprecation({
96+
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.`,
97+
correctiveActions: {
98+
manualSteps: [
99+
`Set [${fromPath}.ssl.key] in your kibana configs to enable TLS client authentication to Elasticsearch.`,
100+
],
101+
},
102+
});
103+
}
104+
}
105+
return config;
106+
},
61107
rename('xpack_api_polling_frequency_millis', 'licensing.api_polling_frequency'),
62108
];
63109
};

x-pack/plugins/upgrade_assistant/__jest__/client_integration/overview.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ describe('Overview page', () => {
4545

4646
const kibanaDeprecationsMockResponse: DomainDeprecationDetails[] = [
4747
{
48-
correctiveActions: {},
48+
correctiveActions: { manualSteps: ['test-step'] },
4949
domainId: 'xpack.spaces',
5050
level: 'critical',
5151
message:

0 commit comments

Comments
 (0)