|
5 | 5 | import shutil
|
6 | 6 | import textwrap
|
7 | 7 | import threading
|
8 |
| -from typing import List |
| 8 | +from typing import List, Optional |
9 | 9 |
|
10 | 10 | import semver
|
11 | 11 |
|
|
18 | 18 | OPENSEARCH_PLUGIN_LIST,
|
19 | 19 | )
|
20 | 20 | from localstack.packages import InstallTarget, Package, PackageInstaller
|
21 |
| -from localstack.packages.java import java_package |
22 | 21 | from localstack.services.opensearch import versions
|
23 | 22 | from localstack.utils.archives import download_and_extract_with_retry
|
24 | 23 | from localstack.utils.files import chmod_r, load_file, mkdir, rm_rf, save_file
|
@@ -50,15 +49,6 @@ class OpensearchPackageInstaller(PackageInstaller):
|
50 | 49 | def __init__(self, version: str):
|
51 | 50 | super().__init__("opensearch", version)
|
52 | 51 |
|
53 |
| - # JRE version to use |
54 |
| - # OpenSearch has the widest compatibility with Java 11 |
55 |
| - # See: https://opensearch.org/docs/latest/install-and-configure/install-opensearch/index/#java-compatibility |
56 |
| - self.java_version = "11" |
57 |
| - |
58 |
| - def _prepare_installation(self, target: InstallTarget) -> None: |
59 |
| - # OpenSearch ships with a bundled JRE, but we still use LocalStack's JRE for predictability |
60 |
| - java_package.get_installer(self.java_version).install(target) |
61 |
| - |
62 | 52 | def _install(self, target: InstallTarget):
|
63 | 53 | # locally import to avoid having a dependency on ASF when starting the CLI
|
64 | 54 | from localstack.aws.api.opensearch import EngineType
|
@@ -223,18 +213,11 @@ def _get_opensearch_install_version(self) -> str:
|
223 | 213 |
|
224 | 214 |
|
225 | 215 | class ElasticsearchPackageInstaller(PackageInstaller):
|
| 216 | + java_home: Optional[str] |
| 217 | + |
226 | 218 | def __init__(self, version: str):
|
227 | 219 | super().__init__("elasticsearch", version)
|
228 | 220 |
|
229 |
| - # JRE version to use |
230 |
| - # ElasticSearch has the widest compatibility with Java 8 |
231 |
| - # See: https://www.elastic.co/support/matrix |
232 |
| - self.java_version = "8" |
233 |
| - |
234 |
| - def _prepare_installation(self, target: InstallTarget) -> None: |
235 |
| - # ElasticSearch ships with a bundled JRE, but we still use LocalStack's JRE for predictability |
236 |
| - java_package.get_installer(self.java_version).install(target) |
237 |
| - |
238 | 221 | def _install(self, target: InstallTarget):
|
239 | 222 | # locally import to avoid having a dependency on ASF when starting the CLI
|
240 | 223 | from localstack.aws.api.opensearch import EngineType
|
|
0 commit comments