pyhocon icon indicating copy to clipboard operation
pyhocon copied to clipboard

Fix broken overrides

Open afanasev opened this issue 2 years ago • 1 comments

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.

afanasev avatar Jul 07 '22 13:07 afanasev

Coverage Status

Coverage decreased (-0.9%) to 95.295% when pulling 17a739c062a63e0290aa212a151fb9abf259f31a on afanasev:master into be660deb6d6a5a175d384792e208fd39986758ea on chimpler:master.

coveralls avatar Jul 07 '22 13:07 coveralls

Thank you @afanasev for your PR!

darthbear avatar Feb 12 '23 03:02 darthbear

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.

carolguo-dd avatar Mar 03 '23 16:03 carolguo-dd

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?

fsonntag avatar Jan 15 '24 12:01 fsonntag