Skip to content

Commit 2d8cc3a

Browse files
committed
Use default project resolver instead null which caused NPE when running elastic_integration integration tests.
1 parent fa6e905 commit 2d8cc3a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

libs/logstash-bridge/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ other Elasticsearch internals.
66

77
If a change is introduced in a separate Elasticsearch project that causes this project to fail,
88
please consult with members of @elastic/logstash to chart a path forward.
9+
10+
## How to build the module?
11+
```shell
12+
./gradlew :lib:logstash-bridge:build
13+
```

libs/logstash-bridge/src/main/java/org/elasticsearch/logstashbridge/script/ScriptServiceBridge.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
package org.elasticsearch.logstashbridge.script;
1010

11+
import org.elasticsearch.cluster.project.DefaultProjectResolver;
1112
import org.elasticsearch.cluster.project.ProjectResolver;
1213
import org.elasticsearch.common.settings.Settings;
1314
import org.elasticsearch.core.FixForMultiProject;
@@ -68,8 +69,8 @@ private static ScriptService getScriptService(final Settings settings, final Lon
6869
MustacheScriptEngine.NAME,
6970
new MustacheScriptEngine(settings)
7071
);
71-
@FixForMultiProject // Should this be non-null?
72-
final ProjectResolver projectResolver = null;
72+
@FixForMultiProject // Should this be non-DefaultProjectResolver?
73+
final ProjectResolver projectResolver = DefaultProjectResolver.INSTANCE;
7374
return new ScriptService(settings, scriptEngines, ScriptModule.CORE_CONTEXTS, timeProvider, projectResolver);
7475
}
7576

0 commit comments

Comments
 (0)