diff --git a/tests/install_upgrade_operators/product_install/conftest.py b/tests/install_upgrade_operators/product_install/conftest.py index 4835130be6..77eecf664c 100644 --- a/tests/install_upgrade_operators/product_install/conftest.py +++ b/tests/install_upgrade_operators/product_install/conftest.py @@ -283,12 +283,11 @@ def installed_hpp(cluster_backend_storage, hpp_volume_size): @pytest.fixture(scope="session") def cnv_version_to_install_info(is_production_source, ocp_current_version, cnv_image_url): if is_production_source: - latest_z_stream = get_latest_stable_released_z_stream_info( - minor_version=f"v{ocp_current_version.major}.{ocp_current_version.minor}" - ) + minor_version = f"{ocp_current_version.major}.{ocp_current_version.minor}" + latest_z_stream = get_latest_stable_released_z_stream_info(minor_version=f"v{minor_version}") LOGGER.info( - f"Using production catalog source for: {ocp_current_version}," - f" CNV latest stable released version info: {latest_z_stream}" + f"Using production catalog source for: {minor_version}. " + f"CNV latest stable released version info: {latest_z_stream}" ) else: latest_z_stream = get_cnv_info_by_iib(iib=cnv_image_url.split(":")[-1]) diff --git a/utilities/infra.py b/utilities/infra.py index abe6a63ac8..9f2c7152a8 100644 --- a/utilities/infra.py +++ b/utilities/infra.py @@ -1519,18 +1519,15 @@ def stable_channel_released_to_prod(channels: list[dict[str, str | bool]]) -> bo def get_latest_stable_released_z_stream_info(minor_version: str) -> dict[str, str] | None: builds = wait_for_version_explorer_response( - api_end_point="GetBuildsWithErrata", - query_string=f"minor_version={minor_version}", + api_end_point="GetReleasedBuilds", + query_string=f"minor_version={minor_version}&stage=false", )["builds"] latest_z_stream = None for build in builds: - if build["errata_status"] == "SHIPPED_LIVE" and stable_channel_released_to_prod(channels=build["channels"]): + if stable_channel_released_to_prod(channels=build["channels"]): build_version = Version(version=build["csv_version"]) - if latest_z_stream: - if build_version > latest_z_stream: - latest_z_stream = build_version - else: + if not latest_z_stream or build_version > latest_z_stream: latest_z_stream = build_version return get_build_info_dict(version=str(latest_z_stream)) if latest_z_stream else None