mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[es] skip exact version warning in dev (#25350)
* [es] skip exact version warning in dev
* feedback
* Revert "feedback"
This reverts commit f8e8aaed2a
.
* loose mismatch
This commit is contained in:
parent
e75bcdacd1
commit
8c3df98234
2 changed files with 12 additions and 1 deletions
|
@ -42,6 +42,11 @@ describe('plugins/elasticsearch', () => {
|
|||
},
|
||||
url: esTestConfig.getUrl()
|
||||
}
|
||||
},
|
||||
config() {
|
||||
return {
|
||||
get: sinon.stub()
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
*/
|
||||
|
||||
import { forEach, get } from 'lodash';
|
||||
import { coerce } from 'semver';
|
||||
import isEsCompatibleWithKibana from './is_es_compatible_with_kibana';
|
||||
|
||||
/**
|
||||
|
@ -37,6 +38,7 @@ const lastWarnedNodesForServer = new WeakMap();
|
|||
|
||||
export function ensureEsVersion(server, kibanaVersion) {
|
||||
const { callWithInternalUser } = server.plugins.elasticsearch.getCluster('admin');
|
||||
const isProd = server.config().get('env.prod');
|
||||
|
||||
server.log(['plugin', 'debug'], 'Checking Elasticsearch version');
|
||||
return callWithInternalUser('nodes.info', {
|
||||
|
@ -61,7 +63,11 @@ export function ensureEsVersion(server, kibanaVersion) {
|
|||
|
||||
// It's acceptable if ES and Kibana versions are not the same so long as
|
||||
// they are not incompatible, but we should warn about it
|
||||
if (esNode.version !== kibanaVersion) {
|
||||
// In development we ignore, this can be expected when testing against snapshots
|
||||
// or across version qualifiers
|
||||
const exactMisMatch = esNode.version !== kibanaVersion;
|
||||
const looseMismatch = coerce(esNode.version).version !== coerce(kibanaVersion).version;
|
||||
if (isProd && exactMisMatch || looseMismatch) {
|
||||
warningNodes.push(esNode);
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue