Support for Elasticsearch 7.4 (#979)
* Update code generation (#969) * Updated code generation scripts to use the new spec * API generation * Fix bad link * Updated API reference doc (#945) * Updated API reference doc * Updated docs script * Fix issue; node roles are defaulting to true when undefined (fal… (#967) * Fix issue; nodeFilter was unable to filter because master, data, and ingest role were true if even they were false on the node. * Test nodesToHost of BaseConnectionPool correctly maps node roles * API generation * Docker: use 7.4-SNAPSHOT * API generation * Use 7.4 stable
This commit is contained in:
committed by
GitHub
parent
69805d8393
commit
7472c5ee94
@ -474,6 +474,45 @@ test('API', t => {
|
||||
t.end()
|
||||
})
|
||||
|
||||
t.test('Should map roles', t => {
|
||||
const pool = new ConnectionPool({ Connection })
|
||||
const nodes = {
|
||||
a1: {
|
||||
http: {
|
||||
publish_address: 'example.com:9200'
|
||||
},
|
||||
roles: ['master', 'data', 'ingest', 'ml']
|
||||
},
|
||||
a2: {
|
||||
http: {
|
||||
publish_address: 'example.com:9201'
|
||||
},
|
||||
roles: []
|
||||
}
|
||||
}
|
||||
t.same(pool.nodesToHost(nodes, 'http:'), [{
|
||||
url: new URL('http://example.com:9200'),
|
||||
id: 'a1',
|
||||
roles: {
|
||||
master: true,
|
||||
data: true,
|
||||
ingest: true,
|
||||
ml: true
|
||||
}
|
||||
}, {
|
||||
url: new URL('http://example.com:9201'),
|
||||
id: 'a2',
|
||||
roles: {
|
||||
master: false,
|
||||
data: false,
|
||||
ingest: false,
|
||||
ml: false
|
||||
}
|
||||
}])
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user