quarkiverse / quarkus-minio

Minio (https://min.io) Client Quarkus Extension
Apache License 2.0
18 stars 24 forks source link

3.7.2 broke "quarkus.minio.url" in devservices mode #323

Open jendib opened 5 months ago

jendib commented 5 months ago

Hi and thanks for this extension. I'm relying on this code to get the current minio URL:

@ConfigProperty(name = "quarkus.minio.url")
String url;

but since 3.7.2 when Minio is started as a devservice (in unit tests) it's only filled by "localhost" instead of http://localhost:6878 (random port chosen by testcontainers). I'm guessing it has to do with this recent change https://github.com/quarkiverse/quarkus-minio/commit/204a8ae9030c1338153897b860b97577d4f83f77#diff-ac8ae1ef70059d67a0656e95d75eaeb3482ec3c7ec6a6284c1dd7b05bfe8badeR240

jtama commented 5 months ago

Oh I should have mention that change, could you please provider a sample of your usage ?

jendib commented 5 months ago

I just need to get the Minio URL, and because in a test context it's not a fixed value I don't know of any other way, is there?

jtama commented 5 months ago

Yes there is, you need to get the quarkus.minio.port injected as well. Please tell me of this works for you.

I will put up a PR to document this.

jtama commented 5 months ago

@jendib, does it work ?

jtama commented 4 months ago

Closing as I don't have more inputs. Please feel free to re-open if needed.

jendib commented 2 weeks ago

Hello sorry I'm waking up on this finally :)

I did the migration, however I still have one problem: The guide says that quarkus.minio.url must start with http:// or https:// however the Dev Services section says that this configuration property will be

The container host name. It isn’t an URL, it doesn’t contains the exposed port. It’s value will certainly be localhost

There is a contradiction, how can the dev services mode set quarkus.minio.url to something not starting with http:// when it's a requirement?

jtama commented 2 weeks ago

The code is the truth. I forgot to update the doc. host is certainly a better name now.

But documentation aside, could you achieve what you wanted ?

jendib commented 2 weeks ago

So you are saying that I can put quarkus.minio.url=myminio.example.com and it would work even if the documentation says otherwise? If yes that would be great. Currently I have a code specific for dev services which is of course not great.

jtama commented 2 weeks ago

This is exactly what I say. I'll test that tomorrow, and amend the doc and examples.

jtama commented 2 weeks ago

Yup I have to amend the doc and mixed usage in the tests, but actually, the devservice uses localhost as value for the quarkus.minio.url property.

jtama commented 2 weeks ago

@jendib Can you confirm ?

jtama commented 2 weeks ago

@jendib Can you confirmed it works as expected with that clarification ?

jendib commented 2 weeks ago

@jtama It works perfectly, thanks a lot! It would be great indeed to rename quarkus.minio.url to quarkus.minio.host in the future.

jtama commented 2 weeks ago

I will, but I don't want to break other users... SO it will be a long process...