Skip to content

Commit

Permalink
Check if status and phase is set in argo workflow crd (kubeflow#153)
Browse files Browse the repository at this point in the history
* Check if status and phase is set in argo workflow crd

Sometimes it takes a while for the argo controller to populate
the status field of an object.

Fixes kubeflow/testing#147

* Update

* Update
  • Loading branch information
Ankush Agarwal authored and k8s-ci-robot committed Jun 8, 2018
1 parent 2b2d8a1 commit e915ec0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion py/kubeflow/testing/argo_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def wait_for_workflows(client, namespace, names,

done = True
for results in all_results:
if results["status"]["phase"] not in ["Failed", "Succeeded"]:
# Sometimes it takes a while for the argo controller to populate
# the status field of an object.
if results.get("status", {}).get("phase", "") not in ["Failed", "Succeeded"]:
done = False

if done:
Expand Down

0 comments on commit e915ec0

Please sign in to comment.