I should be able to specify object storage properties as env vars, e.g. MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_BUCKET for micronaut.object-storage.oracle-cloud.default.bucket and MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_NAMESPACE for micronaut.object-storage.oracle-cloud.default.namespace
Actual Behaviour
Values are only resolved from config files.
I discussed this with Alvaro and although this affects Object Storage, it's likely a core bug.
Add printlns to Application.java to display resolved values (see attached project)
Specify bucket and namespace as env vars, either with
export MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_BUCKET=foo
export MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_NAMESPACE=bar
./gradlew run
or
MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_BUCKET=foo MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_NAMESPACE=bar ./gradlew run
In both cases the properties are correctly read and available from the ApplicationContext, but there is no enabled ObjectStorageOperations bean (should be io.micronaut.objectstorage.oraclecloud.OracleCloudStorageOperations)
If you hard code the values in application.properties, or in application-foo.properties and run with the "foo" env enabled, it works.
One other weird combination works. If I specify env vars and have one or more related properties in application.properties, it works. Uncomment
in application.properties in the attached app and run with env vars and everything works as expected. Note that any of the 3 properties will cause this, it's not related to the value being true since the default is true.
Expected Behavior
I should be able to specify object storage properties as env vars, e.g. MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_BUCKET for micronaut.object-storage.oracle-cloud.default.bucket and MICRONAUT_OBJECT_STORAGE_ORACLE_CLOUD_DEFAULT_NAMESPACE for micronaut.object-storage.oracle-cloud.default.namespace
Actual Behaviour
Values are only resolved from config files.
I discussed this with Alvaro and although this affects Object Storage, it's likely a core bug.
Steps To Reproduce
Create an app
Add printlns to Application.java to display resolved values (see attached project)
Specify bucket and namespace as env vars, either with
or
In both cases the properties are correctly read and available from the ApplicationContext, but there is no enabled ObjectStorageOperations bean (should be io.micronaut.objectstorage.oraclecloud.OracleCloudStorageOperations)
If you hard code the values in application.properties, or in application-foo.properties and run with the "foo" env enabled, it works.
One other weird combination works. If I specify env vars and have one or more related properties in application.properties, it works. Uncomment
in application.properties in the attached app and run with env vars and everything works as expected. Note that any of the 3 properties will cause this, it's not related to the value being true since the default is true.
Environment Information
No response
Example Application
No response
Version
4.3.8