From 2ad8a17323ecff0c496c75ffa7e74f4783e6a478 Mon Sep 17 00:00:00 2001 From: Pallab Pain Date: Fri, 22 Sep 2023 09:54:27 +0530 Subject: [PATCH] fix(apply): fixes the find_functor for staticroute The find_functor for staticroute was not parsing the name correctly and hence, it led to issue when static routes are used in dependency. --- riocli/apply/resolver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riocli/apply/resolver.py b/riocli/apply/resolver.py index ac4c853f..8adf49ca 100644 --- a/riocli/apply/resolver.py +++ b/riocli/apply/resolver.py @@ -159,8 +159,8 @@ def _find_functors(self, kind): "project": lambda name, projects: filter(lambda i: i.metadata.name == name, projects), "package": lambda name, obj_list, version: filter( lambda x: name == x.name and version == x['packageVersion'], obj_list), - "staticroute": lambda name, obj_list: filter(lambda x: name == '-'.join(x.spec.url.split('-')[:-1]), - obj_list), + "staticroute": lambda name, obj_list: filter( + lambda x: name == x.metadata.name.rsplit('-', 1)[0], obj_list), "build": self._generate_find_guid_functor(name_field='buildName'), "deployment": self._generate_find_guid_functor(), "network": self._generate_find_guid_functor(),