[ML] Handle removal of backend ml.enabled node attribute (#27604)

This commit is contained in:
Pete Harverson 2018-12-21 09:13:30 +00:00 committed by GitHub
parent b807b09f04
commit 9b4a5a07d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -26,7 +26,8 @@ export function systemRoutes(server, commonRouteConfig) {
if (typeof resp.nodes === 'object') {
Object.keys(resp.nodes).forEach((k) => {
if (resp.nodes[k].attributes !== undefined) {
if (resp.nodes[k].attributes['ml.enabled'] === 'true') {
const maxOpenJobs = resp.nodes[k].attributes['ml.max_open_jobs'];
if (maxOpenJobs !== null && maxOpenJobs > 0) {
count++;
}
}

View file

@ -51,8 +51,7 @@ describe('map nodes info', () => {
transport_address: '127.0.0.1:9300',
attributes: {
'ml.machine_memory': '17179869184',
'ml.max_open_jobs': '20',
'ml.enabled': 'true'
'ml.max_open_jobs': '20'
}
}
}

View file

@ -108,7 +108,8 @@ describe('get_pipeline', () => {
ip: '127.0.0.1',
name: 'B0buMd-',
attributes: {
'ml.enabled': 'true'
'ml.machine_memory': '17179869184',
'ml.max_open_jobs': '20'
}
},
logstash_state: {