Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion components/camel-opensearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

<properties>
<!-- OpenSearch container is not available on these platforms -->
<skipITs.ppc64le>true</skipITs.ppc64le>
<skipITs.s390x>true</skipITs.s390x>

<camel.surefire.reuseForks>true</camel.surefire.reuseForks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public final class OpenSearchProperties {
public static final String OPEN_SEARCH_USERNAME = "opensearch.username";
public static final String OPEN_SEARCH_PASSWORD = "opensearch.password";
public static final String OPEN_SEARCH_CONTAINER = "opensearch.container";
public static final String OPEN_SEARCH_CONTAINER_PPC64LE = "opensearch.container.ppc64le";
public static final String OPEN_SEARCH_CONTAINER_STARTUP
= OPEN_SEARCH_CONTAINER + ContainerEnvironmentUtil.STARTUP_ATTEMPTS_PROPERTY;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.shaded.org.apache.commons.lang3.SystemUtils;
import org.testcontainers.utility.DockerImageName;

public class OpenSearchLocalContainerService implements OpenSearchService, ContainerService<OpensearchContainer> {
private static final Logger LOG = LoggerFactory.getLogger(OpenSearchLocalContainerService.class);
Expand All @@ -38,7 +40,15 @@ public class OpenSearchLocalContainerService implements OpenSearchService, Conta

public OpenSearchLocalContainerService() {
this(LocalPropertyResolver.getProperty(OpenSearchLocalContainerService.class,
OpenSearchProperties.OPEN_SEARCH_CONTAINER));
getPropertyKeyForContainerImage()));
}

private static String getPropertyKeyForContainerImage() {
if ("ppc64le".equals(SystemUtils.OS_ARCH)) {
return OpenSearchProperties.OPEN_SEARCH_CONTAINER_PPC64LE;
} else {
return OpenSearchProperties.OPEN_SEARCH_CONTAINER;
}
}

public OpenSearchLocalContainerService(String imageName) {
Expand All @@ -50,7 +60,9 @@ public OpenSearchLocalContainerService(OpensearchContainer container) {
}

protected OpensearchContainer initContainer(String imageName) {
OpensearchContainer opensearchContainer = new OpensearchContainer(imageName);
DockerImageName customImage = DockerImageName.parse(imageName)
.asCompatibleSubstituteFor("opensearchproject/opensearch");
OpensearchContainer opensearchContainer = new OpensearchContainer(customImage);
// Increase the timeout from 60 seconds to 90 seconds to ensure that it will be long enough
// on the build pipeline
opensearchContainer.setWaitStrategy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
## limitations under the License.
## ---------------------------------------------------------------------------
opensearch.container=opensearchproject/opensearch:2.14.0
opensearch.container.ppc64le=icr.io/ppc64le-oss/opensearch-ppc64le:2.12.0