pyhocon
pyhocon copied to clipboard
Fix broken overrides
Trying to fix https://github.com/chimpler/pyhocon/issues/271 and similiar issues once again. Added some tests and make them pass. Did NOT check 4 inlude tests since they're not working on Win.
Coverage decreased (-0.9%) to 95.295% when pulling 17a739c062a63e0290aa212a151fb9abf259f31a on afanasev:master into be660deb6d6a5a175d384792e208fd39986758ea on chimpler:master.
Thank you @afanasev for your PR!
Seems like this fix has introduced another problem. we set the the POD_NAMESPACE env variable, but not the K8s_NAMESPACE variable and have below input file
{
k8s {
namespace = ${POD_NAMESPACE}
namespace = ${?K8S_NAMESPACE}
}
host= test-${k8s.namespace}
}
this used to work in 0.3.59 version, but now it breaks with
File "/Users/carol.guo/.pyenv/versions/3.9.7/lib/python3.9/site-packages/pyhocon/config_parser.py", line 695, in resolve_substitutions
raise ConfigSubstitutionException("Cannot resolve {variables}. Check for cycles.".format(
pyhocon.exceptions.ConfigSubstitutionException: Cannot resolve ${k8s.namespace}: (line: 7, col: 21). Check for cycles.
This change also broke some of our configs, see here:
https://github.com/chimpler/pyhocon/issues/320
@darthbear Is it possible to revert this change?