-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 support for postgis container images to postgresql DevService #15919
Comments
Hmmm, could you give me more details about this:
Especially, could you give me the configuration you're trying and that doesn't work? |
@stuartwdouglas as for the compatible image issue, I wonder if we should trust the user and make all provided images compatible? Because I could see how people would try to use non-standard images. |
Related to the separate issue about failing named-datasource configuration: The following actually works with 1.12.2, but fails with the latest Create a starter project: mvn io.quarkus:quarkus-maven-plugin:1.12.2.Final:create \
-DprojectGroupId=org.acme \
-DprojectArtifactId=getting-started \
-DclassName="org.acme.getting.started.GreetingResource" \
-Dpath="/hello" Apply the below patch and run the tests. The Configuration from patch: quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=user1
quarkus.datasource.secondary.db-kind=postgresql
quarkus.datasource.secondary.username=user1
#quarkus.datasource.secondary.jdbc.driver=x
# test datasources
%test.quarkus.datasource.db-kind=other
%test.quarkus.datasource.jdbc.driver=org.testcontainers.jdbc.ContainerDatabaseDriver
%test.quarkus.datasource.jdbc.url=jdbc:tc:postgis:latest:///db1?currentSchema=public,schema1
%test.quarkus.datasource.secondary.db-kind=other
%test.quarkus.datasource.secondary.jdbc.driver=org.testcontainers.jdbc.ContainerDatabaseDriver
%test.quarkus.datasource.secondary.jdbc.url=jdbc:tc:postgis:latest:///db1 The reason we don't have the JDBC URLs specified in application.properties for profiles other then The patch:
|
We trust the user that they have supplied an appropriate image. Fixes quarkusio#15919
The driver issue is because you have not included our postgresql extension, just the driver directly. I am not sure how it worked previously. |
We trust the user that they have supplied an appropriate image. Fixes quarkusio#15919
I have updated the reproducer for the driver configuration issue and included the postgresql extension: https://github.com/matjazs/quarkus-test-named-vs-default-datasource-config We actually do have a postgresql extension included in our code, but I have excluded it in reproducer initially to present the minimal setup causing the error we get in our code. Adding the extension doesn't really change the outcome. |
I added the extension to the diff based reproducer above and it worked. |
That's strange, I have tried with locally built Quarkus snapshot using the latest main branch and also the one from Sonatype. The extension I have added is:
Maven and Java version
The test is still failing, am I missing something here? |
We trust the user that they have supplied an appropriate image. Fixes quarkusio#15919 (cherry picked from commit ad9be98)
Ah, I just added the extension and dev mode started working. This appears to be a config issue with profiles rather than something data source specific, I am investigating. |
@radcortez this is caused by 8d85f22 calling ConfigSource.getPropertyNames() won't take profiles into account, so if the name is only defined in a property it will be ignored and the value won't be set. What issue is this commit fixing? I think we need to revert it, and add a test for this scenario in our test-extension. |
The commit was to fix the issue reported in #15389. Since the defaults were registered in main properties, if you change the runtime profile, these may not be valid anymore, so I ended up registering all profiles in the default to be handled in the same way. |
Let me have a look and I'll fix this. |
Description
DevServices support for PostgreSQL database does not work for
postgis
images. If you specify a custom image, e.g.:image name verification fails, since
postgis
is not recognised as apostgresql
compatible substitute.I have stumbled upon this issue since our previously working TestContainers configuration stopped working with Quarkus 1.12. Specifying db-kind
other
and TestContainers JDBC driver and URL somehow works for the default datasource but fails for the named datasource:Implementation ideas
I made a patch to allow for specifying
postgis
images withpostgresql
db-kind, .e.g.:The text was updated successfully, but these errors were encountered: