Repository navigation
Unify config parsing - #675
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
full ack |
|
Should this have a changelog, or not? |
@phil-davis yes absolutely. And before merging it I would like to update all the other extensions aligned to these changes. Please do not merge yet :) |
|
@refs good to know - I saw the green approval tick from @felixboehm and I'm glad I asked. |
3b3ead1 to
fa7f137
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
fixing #671
It should work both in the standalone
proxycommand and embedded in theociscommand (as a subcommand). Here are some examples and expected behaviors:As a standalone
proxycommand (cdproxy):precondition: create a
proxy.jsonfile on/etc/ocis. The easiest way is to move the one on/proxy:mv config/proxy-example-migration.json /etc/ocis/proxy.jsonAs an embedded subcommand on
ocisproxycommand (cdproxy):Other things this PR address
The ocis root command was never parsing any config whatsoever. This PR allows for configuring high level settings for the root command in the same fashion as its extensions, with the only difference being these global options cascade down to ocis extensions it embeds.
A clear example of this is the following scenario:
ocison/etc/ocis/ocis.jsonwith the following contents:By this point, you should see a log wall similar to this:
(please note that this is but a portion of the entire logs...)
The point being all extensions configuring the same logging configuration. Now, while cascading works as expected, extensions can still override them using their own config files / environment variables. Let's see an example of it.
proxy.jsonconfig file, also on/etc/ociswith the following contents:Now the log wall should look familiar to the previous step, with the only difference being the proxy service loading its log values from its own configuration file on
/etc/ocis/proxy.json:Please note that the premise of this PR on keeping parsing order stays present. In fact with both config files existing from previous steps, running the following command
will effectively override the value on
/etc/ocis/proxy.jsonregarding the log level, the ones that are not overridden remain as parsed from the config file.