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

Environment variable is not read #37273

Closed
vpaiva opened this issue Nov 22, 2023 · 10 comments · Fixed by #37987
Closed

Environment variable is not read #37273

vpaiva opened this issue Nov 22, 2023 · 10 comments · Fixed by #37987
Assignees
Labels
area/gradle Gradle area/native-image kind/bug Something isn't working
Milestone

Comments

@vpaiva
Copy link

vpaiva commented Nov 22, 2023

Describe the bug

When declaring an expression, it is not retrieved via Environment in native mode.
I've been using this way since version 1.5 of quarkus.

Expected behavior

I want my application to recognize the env property.

Actual behavior

No response

How to Reproduce?

I declare the configuration in application.yaml:

quarkus:
consul-config:
agent:
host-port: "${consul.host:localhost}:8500"

I do one export CONSUL_HOST=192.168.1.5

Output of uname -a or ver

No response

Output of java -version

17.0.9

Mandrel or GraalVM version (if different from Java)

mandrel

Quarkus version or git rev

3.5.3

Build tool (ie. output of mvnw --version or gradlew --version)

gradle 8.4

Additional information

No response

@vpaiva vpaiva added area/native-image kind/bug Something isn't working labels Nov 22, 2023
Copy link

quarkus-bot bot commented Nov 22, 2023

/cc @Karm (mandrel), @galderz (mandrel), @zakkak (mandrel)

@zakkak
Copy link
Contributor

zakkak commented Nov 23, 2023

Reminds me of #33321

@vpaiva can you please provide a reproducer, e.g. a gradle project including a test that fails?

@vpaiva
Copy link
Author

vpaiva commented Nov 29, 2023

@vpaiva
Copy link
Author

vpaiva commented Dec 11, 2023

@aloubyansky Is there anything you can do as an alternative to this problem? This is making it impossible to update quarkus services.

@gsmet
Copy link
Member

gsmet commented Dec 11, 2023

Also ping @radcortez

@vpaiva
Copy link
Author

vpaiva commented Dec 11, 2023

@radcortez Is there anything you can do as an alternative to this problem? This is making it impossible to update quarkus services.

@radcortez
Copy link
Member

You can use the actual property name instead of the expression. For instance, for the reproducer, export QUARKUS_BANNER_ENABLED=true works as expected.

@vpaiva
Copy link
Author

vpaiva commented Dec 11, 2023

It really works. Thanks @radcortez!

@vpaiva
Copy link
Author

vpaiva commented Dec 14, 2023

@radcortez Is there a way to prioritize this bug?
We use many variables that are loaded via external services.

@radcortez
Copy link
Member

I can try to have a look, but this is not an issue with Config directly but with the Gradle plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/native-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants