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

ConfigProvider.getConfig() should take profile into account #5223

Closed
loicmathieu opened this issue Nov 5, 2019 · 4 comments
Closed

ConfigProvider.getConfig() should take profile into account #5223

loicmathieu opened this issue Nov 5, 2019 · 4 comments
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists

Comments

@loicmathieu
Copy link
Contributor

Describe the bug
Following the discussion for #4869 it appears that when accessing the Config object from ConfigProvider.getConfig(), profiles is not taken into account.

Reading the spec, this is the prefered way to access the configuration programmaticaly

The current configuration of an application can be accessed via ConfigProvider#getConfig().

https://github.com/eclipse/microprofile-config#design

Expected behavior
ConfigProvider.getConfig() take profiles into account.

Additional context
It has been suggested to use a ConfigResolver, but this is less obvious for a user and some internal Quarkus code already use ConfigProvider.getConfig() so it is a bug already present in Quarkus.

@dmlloyd
Copy link
Member

dmlloyd commented Nov 5, 2019

The bug is that ConfigProvider.getConfig() and ConfigProviderResolver.instance().getConfig() are unfortunately returning different instances. This is codified in the existing bug report #4653 #4512 (sorry, had written the wrong issue number).

It does not have any relationship to profiles.

@loicmathieu
Copy link
Contributor Author

@dmlloyd this is not #4653 as it's about GraalVM updates.

I was a mis-understanding relationship to profiles, but anyway, the important thing is to fix it to be able to offers an undertandable (and standard) way to access the config programmatically.

@dmlloyd
Copy link
Member

dmlloyd commented Nov 6, 2019

I guess I had a clipboard/brain malfunction. I corrected the issue link.

@loicmathieu
Copy link
Contributor Author

OK , closed this one and link the documentation PR to #4512

@gsmet gsmet changed the title ConfigProvider.getConfig() should takes profile into account ConfigProvider.getConfig() should take profile into account Nov 15, 2019
@gsmet gsmet added the triage/duplicate This issue or pull request already exists label Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working triage/duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants