Skip to content

Commit

Permalink
Add pgvector/pgvector as a compatible image (#7898) (#8401)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddumelendez committed Feb 28, 2024
1 parent e9902d5 commit bfb837b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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

0 comments on commit bfb837b

Please sign in to comment.