From bbf0180e2cdb759c904d2053067dc563740c2960 Mon Sep 17 00:00:00 2001 From: Unnati Solanki Date: Tue, 14 Oct 2025 12:51:29 +0530 Subject: [PATCH] [patch] Waiting for crd condition --- src/mas/devops/ocp.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/mas/devops/ocp.py b/src/mas/devops/ocp.py index b4b5a903..4aa638a1 100644 --- a/src/mas/devops/ocp.py +++ b/src/mas/devops/ocp.py @@ -151,14 +151,19 @@ def waitForCRD(dynClient: DynamicClient, crdName: str) -> bool: try: crd = crdAPI.get(name=crdName) conditions = crd.status.conditions - for condition in conditions: - if condition.type == "Established": - if condition.status == "True": - foundReadyCRD = True - else: - logger.debug(f"Waiting 5s for {crdName} CRD to be ready before checking again ...") - sleep(5) - continue + if conditions is None: + logger.debug(f"Looking for status.conditions to be available to iterate for {crdName}") + sleep(5) + continue + else: + for condition in conditions: + if condition.type == "Established": + if condition.status == "True": + foundReadyCRD = True + else: + logger.debug(f"Waiting 5s for {crdName} CRD to be ready before checking again ...") + sleep(5) + continue except NotFoundError: logger.debug(f"Waiting 5s for {crdName} CRD to be installed before checking again ...") sleep(5)