Skip to content

Commit

Permalink
Allow user-provided Elasticsearch dev service container env to overri…
Browse files Browse the repository at this point in the history
…de defaults
  • Loading branch information
yrodiere committed Aug 2, 2023
1 parent 6345274 commit 0505e93
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,16 @@ private DevServicesResultBuildItem.RunningDevService startElasticsearch(
}
timeout.ifPresent(container::withStartupTimeout);

container.withEnv(config.containerEnv);
container.addEnv("ES_JAVA_OPTS", config.javaOpts);
// Disable security as else we would need to configure it correctly to avoid tons of WARNING in the log
container.addEnv("xpack.security.enabled", "false");
// Disable disk-based shard allocation thresholds:
// in a single-node setup they just don't make sense,
// and lead to problems on large disks with little space left.
// See https://www.elastic.co/guide/en/elasticsearch/reference/8.8/modules-cluster.html#disk-based-shard-allocation
container.addEnv( "cluster.routing.allocation.disk.threshold_enabled", "false" );
container.addEnv("cluster.routing.allocation.disk.threshold_enabled", "false");

container.withEnv(config.containerEnv);

container.start();
return new DevServicesResultBuildItem.RunningDevService(Feature.ELASTICSEARCH_REST_CLIENT_COMMON.getName(),
Expand Down

0 comments on commit 0505e93

Please sign in to comment.