Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pgvector/pgvector as a compatible image (#7898) #8401

Merged
merged 1 commit into from
Feb 28, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* Testcontainers implementation for PostgreSQL.
* <p>
* Supported image: {@code postgres}
* Supported images: {@code postgres}, {@code pgvector/pgvector}
* <p>
* Exposed ports: 5432
*/
Expand All @@ -25,6 +25,8 @@ public class PostgreSQLContainer<SELF extends PostgreSQLContainer<SELF>> extends

private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("postgres");

private static final DockerImageName PGVECTOR_IMAGE_NAME = DockerImageName.parse("pgvector/pgvector");

public static final Integer POSTGRESQL_PORT = 5432;

static final String DEFAULT_USER = "test";
Expand Down Expand Up @@ -53,7 +55,7 @@ public PostgreSQLContainer(final String dockerImageName) {

public PostgreSQLContainer(final DockerImageName dockerImageName) {
super(dockerImageName);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME, PGVECTOR_IMAGE_NAME);

this.waitStrategy =
new LogMessageWaitStrategy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ public class CompatibleImageTest extends AbstractContainerDatabaseTest {
public void pgvector() throws SQLException {
try (
// pgvectorContainer {
PostgreSQLContainer<?> pgvector = new PostgreSQLContainer<>(
DockerImageName.parse("pgvector/pgvector:pg16").asCompatibleSubstituteFor("postgres")
)
PostgreSQLContainer<?> pgvector = new PostgreSQLContainer<>("pgvector/pgvector:pg16")
// }
) {
pgvector.start();
Expand Down