-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Stork environment variable resolution not working properly #41344
Comments
/cc @aureamunoz (stork), @cescoffier (stork) |
cc @radcortez |
Is this a new issue, or has it worked in the past? |
I don't know exactly when it stopped working, but it has always worked. The example I put together is a simple example to illustrate the problem. I actually noticed it in the superheroes sample when trying to run the docker compose files. |
We had a similar report on reactive messaging. I suspect it is related. |
if you clone https://github.com/quarkusio/quarkus-super-heroes,
The compose file (https://github.com/quarkusio/quarkus-super-heroes/blob/main/rest-fights/deploy/docker-compose/java17.yml) looks like this:
|
I can verify it works with Quarkus 3.8, so it broke sometime between 3.8 & current. |
If you clone https://github.com/quarkusio/quarkus-super-heroes/tree/3.8.Final ( and then do
Wait for everything to come up then do |
I believe it is unrelated. I tried the fix from the other issue, but the problem remained. I've also tried with Quarkus |
It is the same issue, but the reproducer misled me. Remember, to be able to set There is indeed an issue where the matching is not currently working, which will be fixed by #41318 |
Why would it resolve to |
In your reproducer the env var does not add quotes to
So it gets translated to |
Got it. I didn't realize I needed the quotes. When using the dot notation ( |
The quotes are required when the map key contains a |
Thank you for the explanation! |
This coincides with quarkusio/quarkus#41344, which won't be released until Quarkus 3.12.1 (next micro-release). Its broken now anyways, so no harm with this change now.
Hey @radcortez I've updated the superheroes app to Quarkus 3.12.2 but this still seems to be broken...I've updated the config:
But yet it still doesn't seem to take. These properties should resolve to quarkus.stork."hero-service".service-discovery.address-list=rest-heroes:8083
quarkus.stork."villain-service".service-discovery.address-list=rest-villains:8084
quarkus.stork."narration-service".service-discovery.address-list=rest-narration:8087 |
What is the error exactly? I've added exactly that mapping to SmallRye Config tests, and it works as expected: |
I'm not getting an error per-se, but the config does not bind properly. |
{
"hero": {
"name": "Fallback hero",
"level": 1,
"picture": "https://dummyimage.com/240x320/1e8fff/ffffff&text=Fallback+Hero",
"powers": "Fallback hero powers"
},
"villain": {
"name": "Fallback villain",
"level": 45,
"picture": "https://dummyimage.com/240x320/b22222/ffffff&text=Fallback+Villain",
"powers": "Fallback villain powers"
}
} Thats because the default config is to go to QUARKUS_STORK__HERO_SERVICE__SERVICE_DISCOVERY_ADDRESS_LIST: rest-heroes:8083
QUARKUS_STORK__VILLAIN_SERVICE__SERVICE_DISCOVERY_ADDRESS_LIST: rest-villains:8084
QUARKUS_STORK__NARRATION_SERVICE__SERVICE_DISCOVERY_ADDRESS_LIST: rest-narration:8087 |
Sorry, I was not clear. When properties override dotted names, the env vars have to follow the same format. So either use:
or
I've just changed the env var to We may consider adding a convenience to support mixed quoted mode. |
You're right, it does work. Maybe I mis-interpreted what you have said. I was under the assumption that I needed to use But using |
Describe the bug
When trying to use Stork and trying to set properties (i.e. the
service-discovery.address-list
property) it doesn't seem to resolve properly.Expected behavior
I would expect to be able to set Stork properties via env variables.
Actual behavior
It doesn't seem that I can express
quarkus.stork.vehicle-data-service.service-discovery.address-list=vpic.nhtsa.dot.gov
as an environment variable.How to Reproduce?
Reproducer:
stork-broken.zip
cd stork-broken
./mvnw clean package
export QUARKUS_STORK_VEHICLE_DATA_SERVICE_SERVICE_DISCOVERY_ADDRESS_LIST=vpic.nhtsa.dot.gov
java -jar target/quarkus-app/quarkus-run.jar
You get the following error:
The value it should be trying to set is
quarkus.stork.vehicle-data-service.service-discovery.address-list=vpic.nhtsa.dot.gov
.You can also try
export QUARKUS_STORK__VEHICLE_DATA_SERVICE__SERVICE_DISCOVERY_ADDRESS_LIST=vpic.nhtsa.dot.gov
java -jar target/quarkus-app/quarkus-run.jar
But that doesn't work either. It has the same error.
Output of
uname -a
orver
Darwin edeandrea-m1pro 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
Output of
java -version
Quarkus version or git rev
3.11.3
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional information
If you run the app in dev mode it should work because I have
%dev.quarkus.stork.vehicle-data-service.service-discovery.address-list=vpic.nhtsa.dot.gov
inapplication.properties
.To see how it should behave, when running dev mode you can
curl http://localhost:8080/vehicle-data/audi
. You should get something back like this:The text was updated successfully, but these errors were encountered: