We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ca23f0b + e33d3ef commit 1c198ebCopy full SHA for 1c198eb
src/elasticsearch/elasticsearch.ts
@@ -37,7 +37,9 @@ export class Elasticsearch {
37
return this.execute(`/_nodes/${instance.privateIp}`).then((json: any) => {
38
if (json._nodes.total === 1) {
39
const nodeId: string = Object.keys(json.nodes)[0];
40
- const isMasterEligible: boolean = json.nodes[nodeId].settings.node.master == 'true' || json.nodes[nodeId].settings.node.roles.includes('master');
+ const isMasterEligible: boolean = json.nodes[nodeId].settings.node.master == 'true'
41
+ || json.nodes[nodeId].settings.node.roles?.includes('master')
42
+ || false;
43
return new ElasticsearchNode(instance, nodeId, isMasterEligible);
44
} else {
45
throw `expected information about a single node, but got: ${JSON.stringify(json)}`;
0 commit comments