Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove previously deprecated elasticsearch.* settings. #29496

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 56 additions & 7 deletions docs/migration/migrate_7_0.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,34 @@ to Kibana's advanced setting.
on each Elasticsearch node, Logstash node, Kibana instance, and Beat to collect and index metrics. Each node and instance is
considered unique based on its persistent UUID, which is written to the path.data directory when the node or instance starts.

[float]
=== kibana.yml setting `xpack.monitoring.elasticsearch.url` is no longer valid
*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.hosts` should be used instead.
In prior versions of Kibana, if no port was specified in `xpack.monitoring.elasticsearch.url` a default of 9200 was chosen.
The port in `xpack.monitoring.elasticsearch.hosts` is protocol dependent: https ports will use 443, and http ports will use 80.

*Impact:* Users with `xpack.monitoring.elasticsearch.url` set should use `xpack.monitoring.elasticsearch.hosts` instead and if
`xpack.monitoring.elasticsearch.url` was dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url.

[float]
=== kibana.yml setting `xpack.monitoring.elasticsearch.ssl.cert` is no longer valid
*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.ssl.certificate` should be used instead.

*Impact:* Users with `xpack.monitoring.elasticsearch.ssl.cert` set should use `xpack.monitoring.elasticsearch.ssl.certificate` instead

[float]
=== kibana.yml setting `xpack.monitoring.elasticsearch.ssl.ca` is no longer valid
*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.ssl.certificateAuthorities` should be used instead.

*Impact:* Users with `xpack.monitoring.elasticsearch.ssl.ca` set should use `xpack.monitoring.elasticsearch.ssl.certificateAuthorities` instead

[float]
=== kibana.yml setting `xpack.monitoring.elasticsearch.ssl.verify` is no longer valid
*Details:* This deprecated setting has been removed and `xpack.monitoring.elasticsearch.ssl.verificationMode` should be used instead.

*Impact:* Users with `xpack.monitoring.elasticsearch.ssl.verify` set should use `xpack.monitoring.elasticsearch.ssl.verificationMode` instead.
Previously set `xpack.monitoring.elasticsearch.ssl.verify` is equal to `xpack.monitoring.elasticsearch.ssl.verificationMode: full`.

[float]
=== Deprecated API `/shorten` has been removed
*Details:* The `/shorten` API has been deprecated since 6.5, when it was replaced by the `/api/shorten_url` API.
Expand All @@ -97,13 +125,6 @@ considered unique based on its persistent UUID, which is written to the path.dat

*Impact:* The logging.useUTC flag will have to be replaced with a timezone id. If set to true the id is `UTC`.

[float]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: I thought it'd make sense to join these two notes into one, let me know if you have a better wording.

=== kibana.yml setting `elasticsearch.url` sets port based on protocol
*Details:* In prior versions of Kibana, if no port was specified in `elasticsearch.url` a default of 9200 was chosen.
The port is now protocol dependent: https ports will use 443, and http ports will use 80.

*Impact:* If your `elasticsearch.url` was dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url.

[float]
=== kibana.yml setting `server.ssl.supportedProtocols` excludes TLSv1 by default
*Details:* TLSv1 support has been removed by default, it's still possible to opt-in to TLSv1 support by explicitly setting
Expand All @@ -129,3 +150,31 @@ It's now required that the user sets `server.ssl.enabled` to true for this to oc
*Details:* This deprecated setting has been removed and `i18n.locale` should be used instead.

*Impact:* Users with `i18n.defaultLocale` set should use `i18n.locale` instead

[float]
=== kibana.yml setting `elasticsearch.url` is no longer valid
*Details:* This deprecated setting has been removed and `elasticsearch.hosts` should be used instead.
In prior versions of Kibana, if no port was specified in `elasticsearch.url` a default of 9200 was chosen. The port in
`elasticsearch.hosts` is protocol dependent: https ports will use 443, and http ports will use 80.

*Impact:* Users with `elasticsearch.url` set should use `elasticsearch.hosts` instead and if `elasticsearch.url` was
dependent on an unspecified port set to 9200, `:9200` will have to be appended to the url.

[float]
=== kibana.yml setting `elasticsearch.ssl.cert` is no longer valid
*Details:* This deprecated setting has been removed and `elasticsearch.ssl.certificate` should be used instead.

*Impact:* Users with `elasticsearch.ssl.cert` set should use `elasticsearch.ssl.certificate` instead

[float]
=== kibana.yml setting `elasticsearch.ssl.ca` is no longer valid
*Details:* This deprecated setting has been removed and `elasticsearch.ssl.certificateAuthorities` should be used instead.

*Impact:* Users with `elasticsearch.ssl.ca` set should use `elasticsearch.ssl.certificateAuthorities` instead

[float]
=== kibana.yml setting `elasticsearch.ssl.verify` is no longer valid
*Details:* This deprecated setting has been removed and `elasticsearch.ssl.verificationMode` should be used instead.

*Impact:* Users with `elasticsearch.ssl.verify` set should use `elasticsearch.ssl.verificationMode` instead.
Previously set `elasticsearch.ssl.verify` is equal to `elasticsearch.ssl.verificationMode: full`.
97 changes: 0 additions & 97 deletions src/legacy/core_plugins/elasticsearch/__tests__/index.js

This file was deleted.

49 changes: 0 additions & 49 deletions src/legacy/core_plugins/elasticsearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
* under the License.
*/

import { compact, get, has, set } from 'lodash';
import { unset } from '../../../utils';

import healthCheck from './lib/health_check';
import { createDataCluster } from './lib/create_data_cluster';
import { createAdminCluster } from './lib/create_admin_cluster';
Expand Down Expand Up @@ -67,52 +64,6 @@ export default function (kibana) {
}).default();
},

deprecations({ rename }) {
const sslVerify = (basePath) => {
const getKey = (path) => {
return compact([basePath, path]).join('.');
};

return (settings, log) => {
const sslSettings = get(settings, getKey('ssl'));

if (!has(sslSettings, 'verify')) {
return;
}

const verificationMode = get(sslSettings, 'verify') ? 'full' : 'none';
set(sslSettings, 'verificationMode', verificationMode);
unset(sslSettings, 'verify');

log(`Config key "${getKey('ssl.verify')}" is deprecated. It has been replaced with "${getKey('ssl.verificationMode')}"`);
};
};

const url = () => {
return (settings, log) => {
const deprecatedUrl = get(settings, 'url');
const hosts = get(settings, 'hosts.length');
if (!deprecatedUrl) {
return;
}
if (hosts) {
log('Deprecated config key "elasticsearch.url" conflicts with "elasticsearch.hosts". Ignoring "elasticsearch.url"');
} else {
set(settings, 'hosts', [deprecatedUrl]);
log('Config key "elasticsearch.url" is deprecated. It has been replaced with "elasticsearch.hosts"');
}
unset(settings, 'url');
};
};

return [
rename('ssl.ca', 'ssl.certificateAuthorities'),
rename('ssl.cert', 'ssl.certificate'),
url(),
sslVerify(),
];
},

uiExports: {
injectDefaultVars(server, options) {
return {
Expand Down
95 changes: 1 addition & 94 deletions x-pack/plugins/monitoring/__tests__/deprecations.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,105 +13,12 @@ describe('monitoring plugin deprecations', function () {
let transformDeprecations;

before(function () {
const noopDeprecation = () => noop;
const deprecations = deprecationsModule({ rename: noopDeprecation });
const deprecations = deprecationsModule();
transformDeprecations = (settings, log = noop) => {
deprecations.forEach(deprecation => deprecation(settings, log));
};
});

it('verificationMode is set to full when elasticsearch.ssl.verify is true', function () {
const settings = {
elasticsearch: {
ssl: {
verify: true
}
}
};

transformDeprecations(settings);
expect(settings.elasticsearch.ssl.verificationMode).to.eql('full');
});

it(`sets verificationMode to none when verify is false`, function () {
const settings = {
elasticsearch: {
ssl: {
verify: false
}
}
};

transformDeprecations(settings);
expect(settings.elasticsearch.ssl.verificationMode).to.be('none');
expect(settings.elasticsearch.ssl.verify).to.be(undefined);
});

it('should log when deprecating verify from false', function () {
const settings = {
elasticsearch: {
ssl: {
verify: false
}
}
};

const log = sinon.spy();
transformDeprecations(settings, log);
expect(log.calledOnce).to.be(true);
});

it('sets verificationMode to full when verify is true', function () {
const settings = {
elasticsearch: {
ssl: {
verify: true
}
}
};

transformDeprecations(settings);
expect(settings.elasticsearch.ssl.verificationMode).to.be('full');
expect(settings.elasticsearch.ssl.verify).to.be(undefined);
});

it('should log when deprecating verify from true', function () {
const settings = {
elasticsearch: {
ssl: {
verify: true
}
}
};

const log = sinon.spy();
transformDeprecations(settings, log);
expect(log.calledOnce).to.be(true);
});

it(`shouldn't set verificationMode when verify isn't present`, function () {
const settings = {
elasticsearch: {
ssl: {}
}
};

transformDeprecations(settings);
expect(settings.elasticsearch.ssl.verificationMode).to.be(undefined);
});

it(`shouldn't log when verify isn't present`, function () {
const settings = {
elasticsearch: {
ssl: {}
}
};

const log = sinon.spy();
transformDeprecations(settings, log);
expect(log.called).to.be(false);
});

describe('cluster_alerts.email_notifications.email_address', function () {
it(`shouldn't log when email notifications are disabled`, function () {
const settings = {
Expand Down
Loading