mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
DataNode: Use the correct architecture for the distribution jar in tests (#16372)
* fix to use the correct architecture for the distribution jar * added check for archive * added missing import
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
package org.graylog.datanode.testinfra;
|
||||
|
||||
import org.graylog.datanode.OpensearchDistribution;
|
||||
import org.graylog.testing.completebackend.DefaultMavenProjectDirProvider;
|
||||
import org.graylog.testing.completebackend.DefaultPluginJarsProvider;
|
||||
import org.graylog.testing.graylognode.MavenPackager;
|
||||
@@ -26,6 +27,7 @@ import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
|
||||
import org.testcontainers.images.builder.ImageFromDockerfile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Duration;
|
||||
import java.util.Collections;
|
||||
@@ -113,7 +115,13 @@ public class DatanodeContainerizedBackend {
|
||||
}
|
||||
|
||||
private static ImageFromDockerfile createDockerImageFile(String opensearchVersion) {
|
||||
final String opensearchTarArchive = "opensearch-" + opensearchVersion + "-linux-x64.tar.gz";
|
||||
final String opensearchTarArchive = "opensearch-" + opensearchVersion + "-linux-" + OpensearchDistribution.archCode(System.getProperty("os.arch")) + ".tar.gz";
|
||||
final Path downloadedOpensearch = Path.of("target", "downloads", opensearchTarArchive);
|
||||
|
||||
if(!Files.exists(downloadedOpensearch)) {
|
||||
throw new RuntimeException("Failed to link opensearch distribution to the datanode docker image, path" + downloadedOpensearch.toAbsolutePath() + " doesn't exist!");
|
||||
}
|
||||
|
||||
return new ImageFromDockerfile("local/graylog-datanode:latest", false)
|
||||
// the following command makes the opensearch tar.gz archive accessible in the docker build context, so it can
|
||||
// be later used by the ADD command
|
||||
|
||||
Reference in New Issue
Block a user