Skip to content

Commit

Permalink
PR review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jportner committed Jan 21, 2020
1 parent fafa45f commit cb8c39b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
27 changes: 16 additions & 11 deletions x-pack/legacy/plugins/monitoring/deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const deprecations = () => {
`Config key "${CLUSTER_ALERTS_ADDRESS_CONFIG_KEY}" will be required for email notifications to work in 7.0."`
);
}

},
(settings, log) => {
const fromPath = 'xpack.monitoring.elasticsearch';
const es = get(settings, 'elasticsearch');
if (es) {
Expand All @@ -35,16 +36,20 @@ export const deprecations = () => {
`Setting [${fromPath}.username] to "elastic" is deprecated. You should use the "kibana" user instead.`
);
}
if (es.ssl) {
if (es.ssl.key !== undefined && es.ssl.certificate === undefined) {
log(
`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.`
);
} else if (es.ssl.certificate !== undefined && es.ssl.key === undefined) {
log(
`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.`
);
}
}
},
(settings, log) => {
const fromPath = 'xpack.monitoring.elasticsearch.ssl';
const ssl = get(settings, 'elasticsearch.ssl');
if (ssl) {
if (ssl.key !== undefined && ssl.certificate === undefined) {
log(
`Setting [${fromPath}.key] without [${fromPath}.certificate] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`
);
} else if (ssl.certificate !== undefined && ssl.key === undefined) {
log(
`Setting [${fromPath}.certificate] without [${fromPath}.key] is deprecated. This has no effect, you should use both settings to enable TLS client authentication to Elasticsearch.`
);
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const KEY = 'xpack.monitoring.elasticsearch';
/*
* Parse a config object's Elasticsearch configuration, reading any
* certificates/keys from the filesystem
*
* TODO: this code can be removed when this plugin is migrated to the Kibana Platform,
* at that point the ElasticsearchClient and ElasticsearchConfig should be used instead
*/
export const parseElasticsearchConfig = (config: any) => {
const es = config.get(KEY);
Expand Down

0 comments on commit cb8c39b

Please sign in to comment.