diff --git a/bonfire/openshift.py b/bonfire/openshift.py index 0bf44d99..b92e91f3 100644 --- a/bonfire/openshift.py +++ b/bonfire/openshift.py @@ -270,6 +270,7 @@ class StatusError(Exception): "daemonset", "clowdapp", "clowdenvironment", + "clowdjobinvocation", "kafka", "kafkaconnect", "pod", @@ -312,6 +313,19 @@ def _get_name_for_kind(kind): raise ValueError(f"unable to find resource name for kind '{kind}'") +def _check_status_condition(status, expected_type, expected_value): + conditions = status.get("conditions", []) + expected_type = str(expected_type).lower() + expected_value = str(expected_value).lower() + + for c in conditions: + status_value = str(c.get("status")).lower() + status_type = str(c.get("type")).lower() + if status_value == expected_value and status_type == expected_type: + return True + return False + + def _check_status_for_restype(restype, json_data): """ Depending on the resource type, check that it is "ready" or "complete" @@ -360,13 +374,17 @@ def _check_status_for_restype(restype, json_data): return True elif restype in ("clowdenvironment", "clowdapp"): - return str(status.get("ready")).lower() == "true" + return _check_status_condition( + status, "DeploymentsReady", "true" + ) and _check_status_condition(status, "ReconciliationSuccessful", "true") + + elif restype == "clowdjobinvocation": + return _check_status_condition( + status, "JobInvocationComplete", "true" + ) and _check_status_condition(status, "ReconciliationSuccessful", "true") elif restype in ("kafka", "kafkaconnect"): - conditions = status.get("conditions", []) - for c in conditions: - if str(c.get("status")).lower() == "true" and c.get("type").lower() == "ready": - return True + return _check_status_condition(status, "ready", "true") def _get_resource_info(item): diff --git a/bonfire/processor.py b/bonfire/processor.py index 8a26e5bc..71f6ef73 100644 --- a/bonfire/processor.py +++ b/bonfire/processor.py @@ -416,6 +416,8 @@ def _get_component_items(self, component_name): # override any specific parameters on this component if requested self._sub_params(component_name, params) + log.debug("parameters for component '%s': %s", component_name, params) + new_items = process_template(template, params)["items"] # override the tags for all occurences of an image if requested diff --git a/cicd/iqe_pod/create_iqe_pod.py b/cicd/iqe_pod/create_iqe_pod.py index 170fa861..f557d863 100644 --- a/cicd/iqe_pod/create_iqe_pod.py +++ b/cicd/iqe_pod/create_iqe_pod.py @@ -15,7 +15,7 @@ def _get_base_pod_cfg(): - iqe_image = os.getenv('IQE_IMAGE', "quay.io/cloudservices/iqe-tests:latest") + iqe_image = os.getenv("IQE_IMAGE", "quay.io/cloudservices/iqe-tests:latest") return { "apiVersion": "v1", "kind": "Pod",