Put node roles support back (#2759)

This commit is contained in:
Josh Mock
2025-04-17 10:45:18 -05:00
committed by GitHub
parent 94a7274647
commit eeb0d94046
3 changed files with 45 additions and 2 deletions

View File

@ -171,7 +171,18 @@ a|`function` - Takes a `Connection` and returns `true` if it can be sent a reque
_Default:_
[source,js]
----
() => true
function defaultNodeFilter (conn) {
if (conn.roles != null) {
if (
// avoid master-only nodes
conn.roles.master &&
!conn.roles.data &&
!conn.roles.ingest &&
!conn.roles.ml
) return false
}
return true
}
----
|`nodeSelector`