Skip to content

Commit cb8c39b

Browse files
committed
PR review feedback
1 parent fafa45f commit cb8c39b

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

x-pack/legacy/plugins/monitoring/deprecations.js

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export const deprecations = () => {
2626
`Config key "${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}" will be required for email notifications to work in 7.0."`
2727
);
2828
}
29-
29+
},
30+
(settings, log) => {
3031
const fromPath = 'xpack.monitoring.elasticsearch';
3132
const es = get(settings, 'elasticsearch');
3233
if (es) {
@@ -35,16 +36,20 @@ export const deprecations = () => {
3536
`Setting [${fromPath}.username] to "elastic" is deprecated. You should use the "kibana" user instead.`
3637
);
3738
}
38-
if (es.ssl) {
39-
if (es.ssl.key !== undefined && es.ssl.certificate === undefined) {
40-
log(
41-
`Setting [${fromPath}.ssl.key] without [${fromPath}.ssl.certificate] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`
42-
);
43-
} else if (es.ssl.certificate !== undefined && es.ssl.key === undefined) {
44-
log(
45-
`Setting [${fromPath}.ssl.certificate] without [${fromPath}.ssl.key] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`
46-
);
47-
}
39+
}
40+
},
41+
(settings, log) => {
42+
const fromPath = 'xpack.monitoring.elasticsearch.ssl';
43+
const ssl = get(settings, 'elasticsearch.ssl');
44+
if (ssl) {
45+
if (ssl.key !== undefined && ssl.certificate === undefined) {
46+
log(
47+
`Setting [${fromPath}.key] without [${fromPath}.certificate] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`
48+
);
49+
} else if (ssl.certificate !== undefined && ssl.key === undefined) {
50+
log(
51+
`Setting [${fromPath}.certificate] without [${fromPath}.key] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`
52+
);
4853
}
4954
}
5055
},

x-pack/legacy/plugins/monitoring/server/es_client/parse_elasticsearch_config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const KEY = 'xpack.monitoring.elasticsearch';
1212
/*
1313
* Parse a config object's Elasticsearch configuration, reading any
1414
* certificates/keys from the filesystem
15+
*
16+
* TODO: this code can be removed when this plugin is migrated to the Kibana Platform,
17+
* at that point the ElasticsearchClient and ElasticsearchConfig should be used instead
1518
*/
1619
export const parseElasticsearchConfig = (config: any) => {
1720
const es = config.get(KEY);

0 commit comments

Comments
 (0)