quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.73k stars 2.67k forks source link

Restarting dev services container does not affect the config properties such as this container URL #18659

Closed sberyozkin closed 3 years ago

sberyozkin commented 3 years ago

Describe the bug

Sorry if the bug description is misleading, hard to tell where the problem is at the moment. I've noticed it while experimenting with Dev Services for Keycloak draft PR. After restarting a container the property which calculates its address is not refreshed in the template.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Can be reproduced with #17364:

  1. update quarkus-quickstarts/security-openid-connect-quickstart's application.properties to only have quarkus.oidc.devservices.grant.type=implicit (remove everything else) and start with quarkus:dev
  2. Go to Dev UI, click on Provider: Keycloak in the OpenId Connect card
  3. You are now at the page which offers an option to Sign In to Keycloak to get Access Token - press it, enter alice:alice when signing in to KC, you are returned back to the spa page where this token can be posted for ex to /api/admin
  4. Update application.properties - remove the grant property, this file is now empty, the container is now restarting
  5. refresh the Dev UI page and click on Provider: Keycloak again - you will indeed see a different page now, no option to Sign In to Keycloak to get Access Token, just Test Service - enter /api/admin into a Service Path and click Test Service and there will be a Connection Exception reported - stop Quarkus - start quarkus:dev again - all is good, this page works as expected

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

quarkus-bot[bot] commented 3 years ago

/cc @stuartwdouglas

sberyozkin commented 3 years ago

There was a problem with the build step - Stuart, FYI, if the restart is not required then the various config property items have to be re-produced - returning null is a problem - I've copied this code myself - perhaps it is not a problem for other extensions