Skip to content

Commit

Permalink
Skip subctl download during deployment in case of downstream unreleased
Browse files Browse the repository at this point in the history
Signed-off-by: Shylesh Kumar Mohan <[email protected]>
  • Loading branch information
shylesh committed Jan 8, 2025
1 parent 57d0ab5 commit 6b8f270
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions ocs_ci/deployment/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import shutil
import requests
import subprocess
import re

import semantic_version
import platform
Expand Down Expand Up @@ -86,8 +87,11 @@ def __init__(self):
self.dr_only_list = []

def deploy(self):
# Download subctl binary in any case.
self.download_binary()
# Download subctl binary in any case except downstream unreleased.
if not (
self.source == "downstream" and self.submariner_release_type == "unreleased"
):
self.download_binary()
if self.source == "upstream":
self.deploy_upstream()
elif self.source == "downstream":
Expand Down Expand Up @@ -173,7 +177,7 @@ def get_submariner_csv_version(self):
"""
csv_version_cmd = (
"oc get submariners.submariner.io -n submariner-operator "
"submariner -o jsonpath='{{.status.gateways[0].version}}'"
"submariner -o jsonpath='{.status.gateways[0].version}'"
)
return run_cmd(csv_version_cmd)

Expand Down Expand Up @@ -201,10 +205,10 @@ def download_downstream_binary(self):
UnsupportedPlatformError : If current platform has no supported subctl binary
"""
if self.submariner_release_type == "unreleased":
subctl_ver = self.get_submariner_csv_version()
version_str = self.get_submariner_csv_version()
else:
subctl_ver = config.ENV_DATA["subctl_version"]
version_str = subctl_ver.split(":")[1]
version_str = subctl_ver.split(":")[1]
pull_secret_path = os.path.join(constants.DATA_DIR, "pull-secret")
processor = platform.processor()
arch = platform.machine()
Expand All @@ -217,7 +221,9 @@ def download_downstream_binary(self):
"Not a supported architecture for subctl binary"
)
if self.submariner_release_type == "unreleased":
unreleased_tag = self.get_submariner_unreleased_tag(subctl_ver)
unreleased_tag = self.get_submariner_unreleased_tag(
re.match(r"(v\d+\.\d+)", version_str).group(1)
)
brew_url = "/".join([constants.SUBMARINER_BREW, "rhacm2-subctl-rhel9:"])
cmd = (
f"oc image extract --filter-by-os linux/{binary_pltfrm} "
Expand Down
2 changes: 1 addition & 1 deletion ocs_ci/ocs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@
SUBMARINER_DOWNSTREAM_UNRELEASED_BUILD_URL = (
"https://datagrepper.engineering.redhat.com/raw?topic=/topic/"
"VirtualTopic.eng.ci.redhat-container-image.pipeline.complete"
"&rows_per_page=25&delta=1296000&contains=submariner-operator-bundle-container-v"
"&rows_per_page=25&delta=12960000&contains=submariner-operator-bundle-container-v"
)
ACM_BREW_BUILD_URL = (
"https://datagrepper.engineering.redhat.com/raw?topic=/topic/"
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def pytest_generate_tests(metafunc):
"""
# For now we are only dealing with multicluster scenarios in this hook
if ocsci_config.multicluster:
if ocsci_config.multicluster and ocsci_config.UPGRADE.get("upgrade", False):
upgrade_parametrizer = get_multicluster_upgrade_parametrizer()
# for various roles which are applicable to current test wrt multicluster, for ex: ACM, primary, secondary etc
roles = None
Expand Down

0 comments on commit 6b8f270

Please sign in to comment.