Skip to content

Commit

Permalink
fix(apply): merge rio namespace with incoming values
Browse files Browse the repository at this point in the history
riocli creates a template namespace named rio that users can access in
their manifests to fetch rapyuta.io specific values like project id,
name, etc. However, if an incoming values file also has a rio attribute
then it leads to a conflict since the CLI doesn't merge them both.

This commit fixes the issue and merged both namespaces.
  • Loading branch information
pallabpain committed Oct 15, 2024
1 parent b744022 commit 5141bcf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion riocli/apply/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ def _get_object_key(obj: dict) -> str:
def _inject_rio_namespace(self, values: typing.Optional[dict] = None) -> dict:
values = values or {}

values['rio'] = {
rio = {
'project': {
'name': self.config.data.get('project_name'),
'guid': self.config.project_guid,
Expand All @@ -466,4 +466,9 @@ def _inject_rio_namespace(self, values: typing.Optional[dict] = None) -> dict:
'email_id': self.config.data.get('email_id'),
}

if 'rio' in values:
values['rio'].update(rio)
else:
values['rio'] = rio

return values

0 comments on commit 5141bcf

Please sign in to comment.