Skip to content

Commit

Permalink
More cleanup after review
Browse files Browse the repository at this point in the history
  • Loading branch information
breskeby committed Jan 24, 2024
1 parent d99f925 commit c6413b7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.images.builder.ImageFromDockerfile;

import java.io.File;
import java.io.IOException;
Expand All @@ -27,6 +26,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.stream.Collectors;

public abstract class DockerEnvironmentAwareTestContainer extends GenericContainer<DockerEnvironmentAwareTestContainer>
Expand Down Expand Up @@ -56,8 +56,8 @@ private static boolean isDockerAvailable() {
}
}

public DockerEnvironmentAwareTestContainer(ImageFromDockerfile imageFromDockerfile) {
super(imageFromDockerfile);
public DockerEnvironmentAwareTestContainer(Future<String> image) {
super(image);
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/idp-fixture/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tasks.register("deployIdpFixtureDockerImages", DockerBuildTask) {
baseImages = ["openjdk:11.0.16-jre"]
noCache = BuildParams.isCi
tags = ["docker.elastic.co/elasticsearch-dev/idp-fixture:1.0"]
getPush().set(BuildParams.isCi)
push = BuildParams.isCI
getPlatforms().addAll( Architecture.values().collect{ it.dockerPlatform } )
}

Expand All @@ -27,7 +27,7 @@ tasks.register("deployOpenLdapFixtureDockerImages", DockerBuildTask) {
baseImages = ["osixia/openldap:1.4.0"]
noCache = BuildParams.isCi
tags = ["docker.elastic.co/elasticsearch-dev/openldap-fixture:1.0"]
getPush().set(true)
push = BuildParams.isCI
getPlatforms().addAll( Architecture.values().collect{ it.dockerPlatform } )
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import org.junit.rules.TemporaryFolder;
import org.testcontainers.containers.Network;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.images.RemoteDockerImage;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -32,14 +32,7 @@ protected IdpTestContainer() {
}

public IdpTestContainer(Network network) {
super(
new ImageFromDockerfile("es-idp-testfixture").withDockerfileFromBuilder(builder -> builder.from(DOCKER_BASE_IMAGE).build())
.withFileFromClasspath("idp/jetty-custom/ssl.mod", "/idp/jetty-custom/ssl.mod")
.withFileFromClasspath("idp/jetty-custom/keystore", "/idp/jetty-custom/keystore")
.withFileFromClasspath("idp/shib-jetty-base/", "/idp/shib-jetty-base/")
.withFileFromClasspath("idp/shibboleth-idp/", "/idp/shibboleth-idp/")
.withFileFromClasspath("idp/bin/", "/idp/bin/")
);
super(new RemoteDockerImage(DOCKER_BASE_IMAGE));
withNetworkAliases("idp");
withNetwork(network);
waitingFor(Wait.forListeningPorts(4443));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer;
import org.junit.rules.TemporaryFolder;
import org.testcontainers.containers.Network;
import org.testcontainers.images.builder.ImageFromDockerfile;
import org.testcontainers.images.RemoteDockerImage;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -29,12 +29,7 @@ public OpenLdapTestContainer() {
}

public OpenLdapTestContainer(Network network) {
super(
new ImageFromDockerfile("es-openldap-testfixture").withDockerfileFromBuilder(builder -> builder.from(DOCKER_BASE_IMAGE).build())
.withFileFromClasspath("openldap/certs", "/openldap/certs/")
.withFileFromClasspath("openldap/ldif/users.ldif", "/openldap/ldif/users.ldif")
.withFileFromClasspath("openldap/ldif/config.ldif", "/openldap/ldif/config.ldif")
);
super(new RemoteDockerImage(DOCKER_BASE_IMAGE));
withNetworkAliases("openldap");
withNetwork(network);
withExposedPorts(389, 636);
Expand Down

0 comments on commit c6413b7

Please sign in to comment.