Skip to content

Commit 097b4ea

Browse files
authored
[IUO][Install] Use "GetReleasedBuilds" instead of of "GetBuildWithErrata" (#4392)
##### Short description: Because of the konflux transition, errata is deperacated, And VE introduced new API call. Use it instead of GetBuildWithErrata for prod installation ##### More details: ##### What this PR does / why we need it: ##### Which issue(s) this PR fixes: ##### Special notes for reviewer: ##### jira-ticket: <!-- full-ticket-url needs to be provided. This would add a link to the pull request to the jira and close it when the pull request is merged If the task is not tracked by a Jira ticket, just write "NONE". --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated version installation fixture logging for improved clarity. * **Refactor** * Enhanced version information querying and build selection logic for improved reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Harel Meir <hmeir@redhat.com>
1 parent db92aa2 commit 097b4ea

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

tests/install_upgrade_operators/product_install/conftest.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,12 +270,11 @@ def installed_hpp(admin_client, cluster_backend_storage, hpp_volume_size):
270270
@pytest.fixture(scope="session")
271271
def cnv_version_to_install_info(is_production_source, ocp_current_version, cnv_image_url):
272272
if is_production_source:
273-
latest_z_stream = get_latest_stable_released_z_stream_info(
274-
minor_version=f"v{ocp_current_version.major}.{ocp_current_version.minor}"
275-
)
273+
minor_version = f"{ocp_current_version.major}.{ocp_current_version.minor}"
274+
latest_z_stream = get_latest_stable_released_z_stream_info(minor_version=f"v{minor_version}")
276275
LOGGER.info(
277-
f"Using production catalog source for: {ocp_current_version},"
278-
f" CNV latest stable released version info: {latest_z_stream}"
276+
f"Using production catalog source for: {minor_version}. "
277+
f"CNV latest stable released version info: {latest_z_stream}"
279278
)
280279
else:
281280
latest_z_stream = get_cnv_info_by_iib(iib=cnv_image_url.split(":")[-1])

utilities/infra.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,18 +1070,15 @@ def stable_channel_released_to_prod(channels: list[dict[str, str | bool]]) -> bo
10701070

10711071
def get_latest_stable_released_z_stream_info(minor_version: str) -> dict[str, str] | None:
10721072
builds = wait_for_version_explorer_response(
1073-
api_end_point="GetBuildsWithErrata",
1074-
query_string=f"minor_version={minor_version}",
1073+
api_end_point="GetReleasedBuilds",
1074+
query_string=f"minor_version={minor_version}&stage=false",
10751075
)["builds"]
10761076

10771077
latest_z_stream = None
10781078
for build in builds:
1079-
if build["errata_status"] == "SHIPPED_LIVE" and stable_channel_released_to_prod(channels=build["channels"]):
1079+
if stable_channel_released_to_prod(channels=build["channels"]):
10801080
build_version = Version(version=build["csv_version"])
1081-
if latest_z_stream:
1082-
if build_version > latest_z_stream:
1083-
latest_z_stream = build_version
1084-
else:
1081+
if not latest_z_stream or build_version > latest_z_stream:
10851082
latest_z_stream = build_version
10861083
return get_build_info_dict(version=str(latest_z_stream)) if latest_z_stream else None
10871084

0 commit comments

Comments
 (0)