Skip to content

Commit 0b5ff95

Browse files
committed
fix(backend): fix inverted condition in podutils and loop bug in rpc/kfp
Fixes #697 Signed-off-by: Naymul Islam <naymul504@gmail.com>
1 parent 95e97ac commit 0b5ff95

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

kale/common/podutils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ def get_container_name():
117117
candidates = [c for c in container_names if all(x not in c for x in potentially_sidecar_names)]
118118
if len(candidates) > 1:
119119
raise RuntimeError(
120-
"Too many container candidates.Cannot infer the"
120+
"Too many container candidates. Cannot infer the"
121121
f" name of the current container from: {candidates} "
122122
)
123-
if len(candidates) > 0:
123+
if len(candidates) == 0:
124124
raise RuntimeError(
125125
"No container names left. Could not infer the name of the running container."
126126
)

kale/rpc/kfp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ def _get_pipeline_id(pipeline_name):
8484
client = _get_client()
8585
token = ""
8686
pipeline_id = None
87-
while pipeline_id is None or token is not None:
87+
while pipeline_id is None and token is not None:
8888
pipelines = client.list_pipelines(page_token=token)
8989
token = pipelines.next_page_token
90-
f = next(filter(lambda x: x.display_name == pipeline_name, pipelines.pipelines), None)
90+
f = next(filter(lambda x: x.display_name == pipeline_name, pipelines.pipelines or []), None)
9191
if f is not None:
9292
pipeline_id = f.pipeline_id
9393
return pipeline_id

0 commit comments

Comments
 (0)