Skip to content

Commit

Permalink
Add vrc enabled for flattening
Browse files Browse the repository at this point in the history
We have now 2 vrcs:

- vrc-default: The default vrc that ramen will pick
- vrc-flatten: Force flattening if an image is a child of another image
  and need to be flattened before replication.

vr-sample was renamed to vr-default to make it clear that it uses
vrc-default.

The new vrc can be used for manual testing or by new e2e tests.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Sep 24, 2024
1 parent b7cba82 commit 69fdfaa
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 17 deletions.
8 changes: 4 additions & 4 deletions test/addons/rbd-mirror/start
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,10 @@ def restart_rbd_mirror_daemon(cluster):
)


def deploy_vrc_sample(cluster):
def deploy_vrc_default(cluster):
print(f"Applying vrc sample in cluster '{cluster}'")
kubectl.apply(
"--filename=vrc-sample.yaml",
"--filename=vrc-default.yaml",
"--namespace=rook-ceph",
context=cluster,
)
Expand Down Expand Up @@ -274,8 +274,8 @@ 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_vrc_default(cluster1)
deploy_vrc_default(cluster2)

deploy_vgrc_sample(cluster1)
deploy_vgrc_sample(cluster2)
Expand Down
20 changes: 10 additions & 10 deletions test/addons/rbd-mirror/test
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,25 @@ def test_volume_replication(primary, secondary):
context=primary,
)

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

print(f"Waiting until vr vr-sample is completed in cluster '{primary}'")
print(f"Waiting until vr vr-default is completed in cluster '{primary}'")
kubectl.wait(
"volumereplication/vr-sample",
"volumereplication/vr-default",
"--for=condition=Completed",
"--namespace=rook-ceph",
"--timeout=300s",
context=primary,
)

print(f"Waiting until vr vr-sample state is primary in cluster '{primary}'")
print(f"Waiting until vr vr-default state is primary in cluster '{primary}'")
kubectl.wait(
"volumereplication/vr-sample",
"volumereplication/vr-default",
"--for=jsonpath={.status.state}=Primary",
"--namespace=rook-ceph",
"--timeout=300s",
Expand Down Expand Up @@ -127,9 +127,9 @@ def test_volume_replication(primary, secondary):
else:
raise RuntimeError(f"Timeout waiting for image {rbd_image}")

print(f"vr vr-sample info on primary cluster '{primary}'")
print(f"vr vr-default info on primary cluster '{primary}'")
kubectl.get(
"volumereplication/vr-sample",
"volumereplication/vr-default",
"--output=yaml",
"--namespace=rook-ceph",
context=primary,
Expand All @@ -139,9 +139,9 @@ 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}'")
print(f"Deleting vr vr-default in primary cluster '{primary}'")
kubectl.delete(
"volumereplication/vr-sample",
"volumereplication/vr-default",
"--namespace=rook-ceph",
context=primary,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
apiVersion: replication.storage.openshift.io/v1alpha1
kind: VolumeReplication
metadata:
name: vr-sample
name: vr-default
spec:
volumeReplicationClass: vrc-sample
volumeReplicationClass: vrc-default
replicationState: primary
dataSource:
kind: PersistentVolumeClaim
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
apiVersion: replication.storage.openshift.io/v1alpha1
kind: VolumeReplicationClass
metadata:
name: vrc-sample
name: vrc-default
spec:
provisioner: rook-ceph.rbd.csi.ceph.com
parameters:
Expand Down
16 changes: 16 additions & 0 deletions test/addons/rbd-mirror/vrc-flatten.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: The RamenDR authors
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: replication.storage.openshift.io/v1alpha1
kind: VolumeReplicationClass
metadata:
name: vrc-flatten
spec:
provisioner: rook-ceph.rbd.csi.ceph.com
parameters:
replication.storage.openshift.io/replication-secret-name: rook-csi-rbd-provisioner
replication.storage.openshift.io/replication-secret-namespace: rook-ceph
schedulingInterval: 1m
flattenMode: force

Check failure on line 16 in test/addons/rbd-mirror/vrc-flatten.yaml

View workflow job for this annotation

GitHub Actions / Linters

16:1 [empty-lines] too many blank lines (1 > 0)

0 comments on commit 69fdfaa

Please sign in to comment.