-
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
String List Maps and String Maps properties are not mapped in BOOTSTRAP phase #9991
Comments
Before I start looking into it, @dmlloyd any quick idea why |
I'd check to see if it works with Also we're already overusing BOOTSTRAP. It will lead to trouble... |
What do you have in mind? |
SmallRye Config has recently gained the ability to configure one source from another source (using the interceptors infrastructure). This allows everything to stay in RUNTIME, while still enabling some configuration properties to be used to set up subsequent sources. |
Gotcha, thanks! @vsevel maybe you want to hold off this PR for the time being? If we can completely do away with |
@geoand sure. is there any issue I could relate to, so that I can catch the notification and know when something is ready? @dmlloyd in vault's case (and I suspect for consul also), the goal is not to use a config source to configure another, but instead to use an extension (e.g. vault) from a config source (e.g. vault config source). and that extension should be able to be implemented using regular cdi beans. this would be a great simplification for the extension itself. right now I have to recode by hand the logic to fetch the vault properties. |
@radcortez would know more |
@vsevel @geoand this is still dependent on #9184
@vsevel not quite sure if I understood correctly what you want to do. Can you provide me more details? |
hello @radcortez the vault extensions can be used as:
Obviously those 2 use cases share the code to read from the vault through its rest api. and they both need to be configured somehow, at minimum the vault url, represented by the the issue I faced when writing the config source was that I could not benefit from property objects such as VaultRuntimeConfig at the time the vault config source gets called on in the original vault PR, @gsmet made some comments about this, reached out to @dmlloyd, who gave some hint about what could be done in this #2897 (comment) so ideally I would have a way to create a if we go a step further, in an ideal world, the system would:
that way I would not have to come up with a VaultManager singleton, that is used by the vault config source.. so we are talking about 2 challenges:
solving just the first one would be a nice improvement in itself. may be I have missed somethign in the way config objects, config sources and managed objects get created. and we could do already a lot better. if so let me know. |
Ah, now I understand. Thank you. I think I have a solution for you :) In SmallRye Config (which Quarkus uses as the Config implementation), we added support for ConfigSources to configure themselves. This is how it looks: It should be straightforward. You provide your This is not released in SmallRye Config, so is Quarkus does not have access to it either, but we should push a release soon and then update Quarkus. Let me know if this works for you. There is still chance to improve it or add things if required. |
@radcortez sounds promising. |
Yes. But not only that, you can remove the init code, since you will have access to the Config Context at the constructor level, so no need to play around with Atomic values :)
Actually, we can :) This is being worked on at the moment: But probably still a few weeks away.
Thank you! |
smallrye/smallrye-config#196 was fixed by smallrye/smallrye-config#313 as part of milestone 1.9.0. waiting for the release. |
the issue was in the vault extension. see #13300 |
Describe the bug
Configuration supports mapping from properties files to complex types such as:
public Map<String, String> stringMap;
public Map<String, List<String>> stringListMap;
public List<String> stringList;
However, when those properties are used in a config loaded during the
BOOTSTRAP
phase, only thestringList
is correctly mapped. The other twostringMap
andstringListMap
are initialized to an empty map, and there are no warns saying that the properties are unknown or unexpected.If we change the phase to be
BUILD_AND_RUN_TIME_FIXED
instead ofBOOTSTRAP
, those properties get mapped appropriately.Expected behavior
stringMap
andstringListMap
should be mapped, just asstringList
.To Reproduce
Steps to reproduce the behavior:
./mvnw clean install -o -Dvault-test-extension.use-tls=true -Dtest-vault -pl extensions/vault/deployment -pl extensions/vault/runtime -pl integration-tests/vault -Dit.test=VaultMultiPathConfigITCase
BUILD_AND_RUN_TIME_FIXED
inVaultRuntimeConfig
, and rerun the test, you should see:Configuration
Environment (please complete the following information):
Running from
HEAD
The text was updated successfully, but these errors were encountered: