Skip to content

Commit

Permalink
Merge pull request #9191 from clacroix12/release-4.11-cherry-pick-pr-…
Browse files Browse the repository at this point in the history
…9072-9147

Release 4.11 cherry pick pr 9072 9147
  • Loading branch information
petr-balogh authored Jan 25, 2024
2 parents ca2d3ee + 1388330 commit b54539f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,12 @@ def post_ocp_deploy(self):
enable_huge_pages()
if config.DEPLOYMENT.get("dummy_zone_node_labels"):
create_dummy_zone_labels()
ibmcloud_ipi = (
config.ENV_DATA["platform"] == constants.IBMCLOUD_PLATFORM
and config.ENV_DATA["deployment_type"] == "ipi"
)
if ibmcloud_ipi:
ibmcloud.label_nodes_region()

def label_and_taint_nodes(self):
"""
Expand Down Expand Up @@ -692,6 +698,7 @@ def deploy_ocs_via_operator(self, image=None):
ibmcloud.add_deployment_dependencies()
if not live_deployment:
create_ocs_secret(self.namespace)
if config.ENV_DATA["platform"] == constants.IBMCLOUD_PLATFORM:
if config.DEPLOYMENT.get("create_ibm_cos_secret", True):
logger.info("Creating secret for IBM Cloud Object Storage")
with open(constants.IBM_COS_SECRET_YAML, "r") as cos_secret_fd:
Expand Down
13 changes: 13 additions & 0 deletions ocs_ci/utility/ibmcloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,3 +518,16 @@ def delete_volume_id(self, volume):
logger.info(f"volume is deleted successfully: {volume}")
else:
logger.info("volume is not deleted")


def label_nodes_region():
"""
Apply the region label to the worker nodes.
Necessary for IBM COS-backed backingstore support.
"""
logger.info("Applying region label to worker nodes")
region = config.ENV_DATA.get("region")
worker_nodes = get_nodes(node_type=constants.WORKER_MACHINE)
for node in worker_nodes:
node.add_label(rf"ibm-cloud\.kubernetes\.io/region={region}")

0 comments on commit b54539f

Please sign in to comment.