Skip to content

Commit

Permalink
[connectedk8s] Optimize the logic of checking completion for cluster-…
Browse files Browse the repository at this point in the history
…diagnostic-checks-job
  • Loading branch information
ms-hujia committed Aug 28, 2024
1 parent b3048a4 commit f5604c7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/connectedk8s/azext_connectedk8s/_precheckutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,7 @@ def executing_cluster_diagnostic_checks_job(corev1_api_instance, batchv1_api_ins
logger.debug("Cluster Diagnostic Checks job Failed")
w.stop()
break
elif job["object"].status.conditions is not None and \
job["object"].status.conditions[0].type == "Complete":
elif any(condition.type == "Complete" for condition in job["object"].status.conditions):
is_job_complete = True
logger.debug("Cluster Diagnostic Checks Job reached completed state")
w.stop()
Expand Down

0 comments on commit f5604c7

Please sign in to comment.