Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tests/install_upgrade_operators/product_install/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Comment thread
hmeir marked this conversation as resolved.
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])
Expand Down
11 changes: 4 additions & 7 deletions utilities/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1479,18 +1479,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

Expand Down
Loading