Merge pull request #1381 from tirongi/bugfix/ElasticClientCustomURL

[BUGFIX/REGRESSION] Fix wrong elastic client setup when use custom URL
This commit is contained in:
Henry Heng
2023-12-13 22:23:48 +00:00
committed by GitHub
@@ -183,6 +183,18 @@ const prepareConnectionOptions = (
} else if (cloudId) {
let username = getCredentialParam('username', credentialData, nodeData)
let password = getCredentialParam('password', credentialData, nodeData)
if (cloudId.startsWith('http')) {
elasticSearchClientOptions = {
node: cloudId,
auth: {
username: username,
password: password
},
tls: {
rejectUnauthorized: false
}
}
} else {
elasticSearchClientOptions = {
cloud: {
id: cloudId
@@ -193,6 +205,7 @@ const prepareConnectionOptions = (
}
}
}
}
return elasticSearchClientOptions
}