-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
As discussed in https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/Best.20way.20to.20get.20config.20profile.20in.20a.20BuildStep.3F
Quarkus currently processes configuration in the deployment stage and generates a bytecode recorded class handling all the necessary configuration thus no longer relying (in theory at least) on the actual configuration files, except for dev mode maybe where Quarkus needs to detect changes to the configuration files and update the configuration.
In native-mode this bytecode recorded class is the only source of configuration (as the configuration files don't get embed in the native executable). In JVM-mode though it looks like that configuration files may still be available. This discrepancy enables JVM-mode to change profiles on the fly, which while not forbidden in native-mode it essentially has no effect as the bytecode recorded class is based on a specific profile and a warning is thrown to let the user know.
This leads to the following questions:
- What has higher priority the recorded bytecode or the configuration files?
- What happens when we change the profile in JVM-mode? Does the bytecode recorded configuration get replaced by the runtime loaded configuration?
- If the configuration files are reachable, isn't SmallRye loading them? Essentially beating the purpose of the bytecode recorded class in the first place?
Implementation ideas
@radcortez suggested disabling SmallRye discovery of configuration files for non-dev, non-test modes. Adding a note that "the discovery class, also looks for external files in a config folder sitting in the working directory, we don't have a way to fine tune. either it is enabled for classpath and folder discovery or none, we would need to enhance it to support it properly"
@zakkak suggested stripping the configuration files after deployment is done