Skip to content

Commit

Permalink
Skip CNV/ODF upgrade when Cluster is already upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
ebattat committed Sep 30, 2024
1 parent 5fe07ce commit d98680c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def run_ocp_upgrade(self, oc: OC):
"""
if f'Cluster version is {self._upgrade_ocp_version}' == oc.get_cluster_status():
logger.info(f'Cluster is already upgraded to: {self._upgrade_ocp_version}')
return 'Cluster is already upgraded'
else:
logger.info(f'Starting OCP upgrade, Start time: {datetime.now().strftime(datetime_format)}')
logger.info(f'Stop OCP healthcheck')
Expand Down
8 changes: 4 additions & 4 deletions benchmark_runner/main/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ def upgrade_ocp_bare_metal(step: str):
bare_metal_operations.connect_to_provisioner()
oc = bare_metal_operations.oc_login()
if step == 'run_bare_metal_ocp_upgrade':
bare_metal_operations.run_ocp_upgrade(oc)
# The LSO/ODF upgrade must be run manually after the OCP upgrade for the channel version; it won't upgrade automatically.
bare_metal_operations.install_ocp_resources(resources=['lso'], upgrade_version=lso_version)
bare_metal_operations.install_ocp_resources(resources=['odf'], upgrade_version=odf_version)
if not bare_metal_operations.run_ocp_upgrade(oc) == 'Cluster is already upgraded':
# The LSO/ODF upgrade must be run manually after the OCP upgrade for the channel version; it won't upgrade automatically.
bare_metal_operations.install_ocp_resources(resources=['lso'], upgrade_version=lso_version)
bare_metal_operations.install_ocp_resources(resources=['odf'], upgrade_version=odf_version)
elif step == 'verify_bare_metal_upgrade_complete':
if bare_metal_operations.is_cluster_upgraded(oc, cnv_version=cnv_version, odf_version=odf_version, lso_version=lso_version):
bare_metal_operations.verify_cluster_is_up(oc)
Expand Down

0 comments on commit d98680c

Please sign in to comment.