Skip to content

Commit

Permalink
Disable globalnet when disable globalnet is checked in jenkins (#10760)
Browse files Browse the repository at this point in the history
* Disable globalnet when disable globalnet is checked in jenkins
  • Loading branch information
prsurve authored Nov 5, 2024
1 parent c99a2bb commit 456011a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
5 changes: 3 additions & 2 deletions ocs_ci/deployment/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
UnsupportedPlatformError,
)
from ocs_ci.utility import templating
from ocs_ci.ocs.utils import get_non_acm_cluster_config
from ocs_ci.ocs.utils import get_non_acm_cluster_config, get_primary_cluster_config
from ocs_ci.utility.utils import (
run_cmd,
run_cmd_interactive,
Expand Down Expand Up @@ -110,7 +110,8 @@ def deploy_downstream(self):
config.switch_ctx(cluster.MULTICLUSTER["multicluster_index"])
self.create_acm_brew_icsp()
config.switch_ctx(old_ctx)
acm_obj.install_submariner_ui()
global_net = get_primary_cluster_config().ENV_DATA.get("enable_globalnet", True)
acm_obj.install_submariner_ui(globalnet=global_net)
acm_obj.submariner_validation_ui()

def create_acm_brew_icsp(self):
Expand Down
7 changes: 4 additions & 3 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,10 @@ def do_deploy_ocs(self):
ocs_install_verification(ocs_registry_image=ocs_registry_image)
# if we have Globalnet enabled in case of submariner with RDR
# we need to add a flag to storagecluster
if (
config.ENV_DATA.get("enable_globalnet", True)
and config.MULTICLUSTER["multicluster_mode"] == "regional-dr"
if config.MULTICLUSTER[
"multicluster_mode"
] == "regional-dr" and get_primary_cluster_config().ENV_DATA.get(
"enable_globalnet", True
):
for cluster in get_non_acm_cluster_config():
config.switch_ctx(cluster.MULTICLUSTER["multicluster_index"])
Expand Down
8 changes: 4 additions & 4 deletions ocs_ci/ocs/acm/acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,13 @@ def install_submariner_ui(self, globalnet=True):
enable_screenshot=True,
)
if ocs_version >= version.VERSION_4_13 and globalnet:
log.info("Enabling globalnet")
log.info(
"Enabling globalnet during submariner installation via ACM console"
)
element = self.find_an_element_by_xpath("//input[@id='globalist-enable']")
self.driver.execute_script("arguments[0].click();", element)
else:
log.error(
"Globalnet is not supported with ODF version lower than 4.13 or it's disabled"
)
log.info("Globalnet is disabled")
log.info("Click on Next button")
self.do_click(self.page_nav["next-btn"])
log.info("Click on 'Enable NAT-T' to uncheck it")
Expand Down
8 changes: 5 additions & 3 deletions ocs_ci/ocs/resources/storage_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
get_provider_internal_node_ips,
add_disk_stretch_arbiter,
)
from ocs_ci.ocs.utils import get_primary_cluster_config
from ocs_ci.ocs.version import get_ocp_version
from ocs_ci.utility.version import (
get_semantic_version,
Expand Down Expand Up @@ -795,9 +796,10 @@ def ocs_install_verification(
verify_device_class_in_osd_tree(ct_pod, device_class)

# RDR with globalnet submariner
if (
config.ENV_DATA.get("enable_globalnet", True)
and config.MULTICLUSTER.get("multicluster_mode") == "regional-dr"
if config.MULTICLUSTER[
"multicluster_mode"
] == "regional-dr" and get_primary_cluster_config().ENV_DATA.get(
"enable_globalnet", True
):
validate_serviceexport()

Expand Down

0 comments on commit 456011a

Please sign in to comment.