Skip to content

Commit

Permalink
fix(oc): write resolver handle readonly flag
Browse files Browse the repository at this point in the history
  • Loading branch information
MatteoVoges committed Sep 20, 2023
1 parent 0d33ee5 commit 4ee9afc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion kapitan/inventory/resolvers.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,22 @@ def write_to_key(destination: str, origin: str, _root_):

# resolve relative interpolations
try:
# TODO: replace with OC.to_object(), when it supports escaped interpolations
copied = copy.deepcopy(content)
OmegaConf.resolve(copied, True)
except Exception as e:
# resolver error
logger.warning(e)

# write resolved content back to _root_
OmegaConf.update(_root_, destination, copied, merge=True, force_add=True)
# OmegaConf.set_readonly(copied.server, False)
# print(copied)
# print(copied.server._get_flag("readonly"))
# TODO: replace current workaround with clean flag overriding
obj = OmegaConf.to_container(copied)
config = OmegaConf.create(obj)

OmegaConf.update(_root_, destination, config, merge=True, force_add=True)
except Exception as e:
raise e
return "DONE"
Expand Down

0 comments on commit 4ee9afc

Please sign in to comment.