-
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
@EndpointDisabled does not work ok with native builds #34738
Comments
@geoand the Javadoc is saying that it actually allows to disable endpoints at runtime but from what I can see, the recorder we are using in |
It seems to work ok native when you go from enabled --> disabled, but not the other way around. Both ways work when not native. |
I would like to help here, but I would need some pointers on how this can work. Otherwise I think it will have to be part of the javadoc + documentation that this feature only works on non-native build, otherwise is is buildTime fixed, and at this point equivalent to |
We should make it work in native mode as well |
From what I can see, the issue is that the disabled status is resolved in @geoand I'm not entirely sure how to fix this as I'm pretty sure we don't want to simply make the deployment runtime. |
Yeah, that's completely true |
I merged the docs updae PR as for the time being I am unsure how to handle this... |
Describe the bug
When using
@EndpointDisabled
with a value of false, then we build the native app. It is impossible to set it to true at runtime. It does work with the jar versionExpected behavior
EndpointDisabled should read the config value at used at runtime when using a native build
Actual behavior
EndpointDisabled uses the build time value only.
How to Reproduce?
Reproducer: https://github.com/manofthepeace/quarkus-endpointdisabled-issue
The application has the following;
hello.enabled=false
in the application.properties@EndpointDisabled(name = "hello.enabled", stringValue = "false", disableIfMissing = true)
onGreetingResource
Steps to reproduce (doing the same steps with the jar will all work OK)
1- Create a native build
2- run it this way
./target/endpoint-disabled-issue-1.0.0-SNAPSHOT-runner
;3-
curl -vv http://localhost:8080/hello
## this returns a 404 and it is ok as the endpoint is disabled by default4- run this way;
HELLO_ENABLED=true ./target/endpoint-disabled-issue-1.0.0-SNAPSHOT-runner
5-
curl -vv http://localhost:8080/hello
## this returns a 404 and it is not ok as the endpoint should be enabledOutput of
uname -a
orver
Darwin Kernel Version 21.6.0
Output of
java -version
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
GraalVM version (if different from Java)
graalvm-jdk-17
Quarkus version or git rev
3.2.0
Build tool (ie. output of
mvnw --version
orgradlew --version
)maven 3.9.1
Additional information
No response
The text was updated successfully, but these errors were encountered: