Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create ICSP for volsync when acm unreleased #11282

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ocs_ci/deployment/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
from ocs_ci.helpers.helpers import (
set_configmap_log_level_rook_ceph_operator,
get_default_storage_class,
update_volsync_channel,
update_volsync_icsp,
)
from ocs_ci.ocs.ui.helpers_ui import ui_deployment_conditions
from ocs_ci.utility.utils import get_az_count
Expand Down Expand Up @@ -3667,7 +3667,7 @@ def deploy(self):
rbddops.deploy()
self.enable_acm_observability()
self.deploy_dr_policy()
update_volsync_channel()
update_volsync_icsp()

# Enable cluster backup on both ACMs
for i in acm_indexes:
Expand Down Expand Up @@ -3847,7 +3847,7 @@ def deploy(self):
self.configure_mirror_peer()
# Deploy dr policy
self.deploy_dr_policy()
update_volsync_channel()
update_volsync_icsp()
# Configure DRClusters for fencing automation
configure_drcluster_for_fencing()

Expand Down
37 changes: 37 additions & 0 deletions ocs_ci/helpers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
update_container_with_mirrored_image,
exec_cmd,
get_ocs_build_number,
wait_for_machineconfigpool_status,
)
from ocs_ci.utility.utils import convert_device_size

Expand Down Expand Up @@ -5433,6 +5434,42 @@ def update_volsync_channel():
)


def update_volsync_icsp():
"""
Update Volsync ImageContentSourcePolicy.

"""
logger.info("Creating ImageContentSourcePolicy for Volsync")
restore_index = config.cur_index
non_acm_clusters = get_non_acm_cluster_config()
from ocs_ci.ocs.resources.pod import delete_pods, get_all_pods

for non_acm_cluster in non_acm_clusters:
index = non_acm_cluster.MULTICLUSTER["multicluster_index"]
config.switch_ctx(index)
run_cmd(f"oc apply -f {constants.ACM_BREW_ICSP_YAML}")
wait_for_machineconfigpool_status("all", timeout=1800)
volsync_pod_list = get_all_pods(
namespace=constants.VOLSYNC_NAMESPACE,
selector_label="app.kubernetes.io/name=volsync",
)
delete_pods(volsync_pod_list, wait=True)
logger.info("Verify volsync pods in Running state")
sample = TimeoutSampler(
timeout=300,
sleep=10,
func=check_pods_status_by_pattern,
pattern="volsync",
namespace=constants.VOLSYNC_NAMESPACE,
expected_status=constants.STATUS_RUNNING,
)
if not sample.wait_for_func_status(result=True):
logger.error(
f"Pod volsync not in {constants.STATUS_RUNNING} after 300 seconds"
)
config.switch_ctx(restore_index)


def verify_nb_db_psql_version(check_image_name_version=True):
"""
Verify that the NooBaa DB PostgreSQL version matches the expectation
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 @@ -1258,7 +1258,7 @@
RDR_OSD_MODE_GREENFIELD = "greenfield"
RDR_OSD_MODE_BROWNFIELD = "brownfield"
RDR_VOLSYNC_CEPHFILESYSTEM_SC = "ocs-storagecluster-cephfs-vrg"

VOLSYNC_NAMESPACE = "volsync-system"

# constants
RBD_INTERFACE = "rbd"
Expand Down