loadFileConfigs + setModuleDefaults: environment variable mappings from library are silently ignored
#900
-
|
When a library loads its own config directory (which includes Environment variables set in the library's How to reproduceLibrary (
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Which is why |
Beta Was this translation helpful? Give feedback.
-
|
Oh, I see what the problem is. This is working as intended. An application is a set of modules that all can have defaults. The application then overrides those defaults, because maybe you configure the module differently in a sidecar versus a service. For instance, changing the User-Agent header in all HTTP requests. The app field in structured logs, Or labels on stats. There have been bugs especially in 3.x where a semi-random interlacing of defaults and environment settings would occur depending on which extensions you use but to the best of my knowledge those have been corrected by a series of PRs by a handful of different contributors. config/default.yml -> myLib.appUser wins because you've changed it for this application. In general I would recommend that if you use Edit to add: That does change how you would tackle extracting a module after the fact, however that also allows feature-toggling the new module off and on, because the new module has a separate namespace for all of its properties from the old, allowing you to fix typos or reorganize the properties to a saner structure. You can use substitute variables or defer if you really do intend the two values to always be identical. |
Beta Was this translation helpful? Give feedback.
Oh, I see what the problem is. This is working as intended.
An application is a set of modules that all can have defaults. The application then overrides those defaults, because maybe you configure the module differently in a sidecar versus a service. For instance, changing the User-Agent header in all HTTP requests. The app field in structured logs, Or labels on stats.
There have been bugs especially in 3.x where a semi-random interlacing of defaults and environment settings would occur depending on which extensions you use but to the best of my knowledge those have been corrected by a series of PRs by a handful of different contributors.
config/default.yml -> myLib.appUser wins because …