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
Cannot override hocon configuration with env variables #115
Comments
I guess hoplite should call .resolve on sources coming from hocon to fix that. |
The other way you can do it is using hoplite's format for ENV vars. ${VAR} |
Thanks for the quick response @sksamuel , I believe the first option is preferable to be fully compatible with HOCON, as this syntax means it would override the value only if it's present, does the later convey the same semantics ? |
No you're right, I'll do it the first way. |
Hi @sksamuel , do you think that this is an easy fix of calling .resolve() to override default values with env variables? Or are you concerned that this may conflict with |
I think calling .resolve() inside the Hocon parser should be sufficient. |
This is fixed in 1.2.1. |
thanks for the quick fix @sksamuel , looking forward to |
hi @sksamuel sorry to bug you again, was wondering if there is a schedule for this release :) Really keen to put in good use :P |
I don't know why it's not showing up. I've released it in sonatype. I'll
try again tonight.
…On Tue, 7 Apr 2020 at 10:26, Konstantinos Papalias ***@***.***> wrote:
hi @sksamuel <https://github.com/sksamuel> sorry to bug you again, was
wondering if there is a schedule for this release :)
Really keen to put in good use :P
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFVSGUYGNYZK4LV57WR6TTRLNA3NANCNFSM4LPWITXA>
.
|
1.2.2 is out btw.
…On Tue, 7 Apr 2020 at 11:04, Stephen Samuel (Sam) ***@***.***> wrote:
I don't know why it's not showing up. I've released it in sonatype. I'll
try again tonight.
On Tue, 7 Apr 2020 at 10:26, Konstantinos Papalias <
***@***.***> wrote:
> hi @sksamuel <https://github.com/sksamuel> sorry to bug you again, was
> wondering if there is a schedule for this release :)
>
> Really keen to put in good use :P
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#115 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAFVSGUYGNYZK4LV57WR6TTRLNA3NANCNFSM4LPWITXA>
> .
>
|
Many thanks for this! I will be using it straight away!
…On Sat, 11 Apr 2020, 05:37 Stephen Samuel, ***@***.***> wrote:
1.2.2 is out btw.
On Tue, 7 Apr 2020 at 11:04, Stephen Samuel (Sam) ***@***.***>
wrote:
> I don't know why it's not showing up. I've released it in sonatype. I'll
> try again tonight.
>
> On Tue, 7 Apr 2020 at 10:26, Konstantinos Papalias <
> ***@***.***> wrote:
>
>> hi @sksamuel <https://github.com/sksamuel> sorry to bug you again, was
>> wondering if there is a schedule for this release :)
>>
>> Really keen to put in good use :P
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#115 (comment)
>,
>> or unsubscribe
>> <
https://github.com/notifications/unsubscribe-auth/AAFVSGUYGNYZK4LV57WR6TTRLNA3NANCNFSM4LPWITXA
>
>> .
>>
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACDV52EBS4B6M3DGMIDELTRL7XYXANCNFSM4LPWITXA>
.
|
Hello,
It seems that when I try to override my HOCON configuration with env variables like this:
and load configuration with:
val config = ConfigLoader().loadConfigOrThrow<Conf>("/application.conf")
hoplite throws the following error:
com.typesafe.config.ConfigException$NotResolved: called valueType() on value with unresolved substitutions, need to Config#resolve() first, see API docs at com.typesafe.config.impl.ConfigDelayedMerge.valueType(ConfigDelayedMerge.java:46) at com.sksamuel.hoplite.hocon.ValueProduction.invoke(HoconParser.kt:51) at com.sksamuel.hoplite.hocon.MapProduction.invoke(HoconParser.kt:41) at com.sksamuel.hoplite.hocon.ValueProduction.invoke(HoconParser.kt:52) at com.sksamuel.hoplite.hocon.MapProduction.invoke(HoconParser.kt:41) at com.sksamuel.hoplite.hocon.HoconParser.load(HoconParser.kt:27) at com.sksamuel.hoplite.ConfigFilePropertySource$node$1.invoke(PropertySource.kt:92) at com.sksamuel.hoplite.ConfigFilePropertySource$node$1.invoke(PropertySource.kt:86) at com.sksamuel.hoplite.arrow.ValidationsKt.ap(validations.kt:23) at com.sksamuel.hoplite.ConfigFilePropertySource.node(PropertySource.kt:91) at com.sksamuel.hoplite.ConfigLoader.loadNode(ConfigLoader.kt:161) at com.sksamuel.hoplite.ConfigLoader.loadConfig(ConfigLoader.kt:149)
This is the default HOCON way of overriding with env variables, is there an alternative syntax to use?
The text was updated successfully, but these errors were encountered: