Skip to content

Commit

Permalink
Kustomize rbd-mirror directory
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <elenage@il.ibm.com>
  • Loading branch information
ELENAGER committed Sep 24, 2024
1 parent 80fb919 commit 583fd54
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 56 deletions.
32 changes: 2 additions & 30 deletions test/addons/rbd-mirror/start
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def disable_rbd_mirror_debug_logs(cluster):
def configure_rbd_mirroring(cluster, peer_info):
print(f"Applying rbd mirror secret in cluster '{cluster}'")

template = drenv.template("rbd-mirror-secret.yaml")
template = drenv.template("start-data/rbd-mirror-secret.yaml")
yaml = template.substitute(peer_info)
kubectl.apply(
"--filename=-",
Expand All @@ -107,11 +107,7 @@ def configure_rbd_mirroring(cluster, peer_info):
)

print(f"Apply rbd mirror to cluster '{cluster}'")
kubectl.apply(
"--filename=rbd-mirror.yaml",
"--namespace=rook-ceph",
context=cluster,
)
kubectl.apply("--kustomize=start-data", context=cluster)


def wait_until_rbd_mirror_is_ready(cluster):
Expand Down Expand Up @@ -222,24 +218,6 @@ def restart_rbd_mirror_daemon(cluster):
)


def deploy_vrc_sample(cluster):
print(f"Applying vrc sample in cluster '{cluster}'")
kubectl.apply(
"--filename=vrc-sample.yaml",
"--namespace=rook-ceph",
context=cluster,
)


def deploy_vgrc_sample(cluster):
print(f"Applying vgrc sample in cluster '{cluster}'")
kubectl.apply(
"--filename=vgrc-sample.yaml",
"--namespace=rook-ceph",
context=cluster,
)


if len(sys.argv) != 3:
print(f"Usage: {sys.argv[0]} cluster1 cluster2")
sys.exit(1)
Expand Down Expand Up @@ -274,10 +252,4 @@ log_blocklist(cluster2)
wait_until_pool_mirroring_is_healthy(cluster1)
wait_until_pool_mirroring_is_healthy(cluster2)

deploy_vrc_sample(cluster1)
deploy_vrc_sample(cluster2)

deploy_vgrc_sample(cluster1)
deploy_vgrc_sample(cluster2)

print("Mirroring was setup successfully")
10 changes: 10 additions & 0 deletions test/addons/rbd-mirror/start-data/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
resources:
- vrc-sample.yaml
- vgrc-sample.yaml
- rbd-mirror.yaml

namespace: rook-ceph
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 4 additions & 26 deletions test/addons/rbd-mirror/test
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@ def rbd_mirror_image_status(cluster, image):


def test_volume_replication(primary, secondary):
print(f"Deploying pvc {PVC_NAME} in cluster '{primary}'")
kubectl.apply(
f"--filename={PVC_NAME}.yaml",
"--namespace=rook-ceph",
context=primary,
)
print(f"Deploying pvc {PVC_NAME} and vr vr-sample in cluster '{primary}'")
kubectl.apply("--kustomize=test-data", context=primary)

print(f"Waiting until pvc {PVC_NAME} is bound in cluster '{primary}'")
kubectl.wait(
Expand All @@ -71,13 +67,6 @@ def test_volume_replication(primary, secondary):
context=primary,
)

print(f"Deploying vr vr-sample in cluster '{primary}'")
kubectl.apply(
"--filename=vr-sample.yaml",
"--namespace=rook-ceph",
context=primary,
)

print(f"Waiting until vr vr-sample is completed in cluster '{primary}'")
kubectl.wait(
"volumereplication/vr-sample",
Expand Down Expand Up @@ -139,19 +128,8 @@ def test_volume_replication(primary, secondary):
image_status = rbd_mirror_image_status(primary, rbd_image)
print(json.dumps(image_status, indent=2))

print(f"Deleting vr vr-sample in primary cluster '{primary}'")
kubectl.delete(
"volumereplication/vr-sample",
"--namespace=rook-ceph",
context=primary,
)

print(f"Deleting pvc {PVC_NAME} in primary cluster '{primary}'")
kubectl.delete(
f"pvc/{PVC_NAME}",
"--namespace=rook-ceph",
context=primary,
)
print(f"Deleting pvc {PVC_NAME} and vr vr-sample in primary cluster '{primary}'")
kubectl.delete("--kustomize=test-data", context=primary)

print(f"Replication from cluster '{primary}' to cluster '{secondary}' succeeded")

Expand Down
9 changes: 9 additions & 0 deletions test/addons/rbd-mirror/test-data/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
resources:
- vr-sample.yaml
- rbd-pvc.yaml

namespace: rook-ceph
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 583fd54

Please sign in to comment.