Skip to content

Commit 687aab7

Browse files
committed
Add support for consistency groups in VRG and DRPC
When protecting standalone PVCs, we are displaying list of protected PVCs in VRG and DRPC. When working with consistency groups, we want to display the list of protected PVCs per consistency groups for better understanding, what was protected Signed-off-by: Elena Gershkovich <elenage@il.ibm.com>
1 parent 3a5254a commit 687aab7

6 files changed

+547
-3
lines changed

api/v1alpha1/drplacementcontrol_types.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ type PlacementDecision struct {
167167
ClusterNamespace string `json:"clusterNamespace,omitempty"`
168168
}
169169

170+
// ProtectedPVCsList defines a group of ProtectedPVCs
171+
type ProtectedPVCsList struct {
172+
// Name of the VolRep/PVC resource
173+
//+optional
174+
Name string `json:"name,omitempty"`
175+
176+
// All the protected pvcs
177+
ProtectedPVCs []string `json:"protectedpvcs,omitempty"`
178+
}
179+
170180
// VRGResourceMeta represents the VRG resource.
171181
type VRGResourceMeta struct {
172182
// Kind is the kind of the Kubernetes resource.
@@ -185,6 +195,10 @@ type VRGResourceMeta struct {
185195
//+optional
186196
ProtectedPVCs []string `json:"protectedpvcs,omitempty"`
187197

198+
// List of CGs that are protected by the VRG resource
199+
//+optional
200+
ProtectedCGs []ProtectedPVCsList `json:"protectedcgs,omitempty"`
201+
188202
// ResourceVersion is a value used to identify the version of the
189203
// VRG resource object
190204
//+optional

api/v1alpha1/volumereplicationgroup_types.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ type ProtectedPVC struct {
307307
VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode,omitempty"`
308308
}
309309

310+
// ProtectedCG defines a group of ProtectedPVCs
311+
type ProtectedCG struct {
312+
ProtectedPVC `json:",inline"`
313+
314+
// List the protected pvcs names
315+
PVCs []string `json:"protectedPVCs,omitempty"`
316+
}
317+
310318
type KubeObjectsCaptureIdentifier struct {
311319
Number int64 `json:"number"`
312320
//+nullable
@@ -325,8 +333,9 @@ type KubeObjectProtectionStatus struct {
325333
type VolumeReplicationGroupStatus struct {
326334
State State `json:"state,omitempty"`
327335

328-
// All the protected pvcs
336+
// One of ProtectedPVCs or ProtectedCGs must be set
329337
ProtectedPVCs []ProtectedPVC `json:"protectedPVCs,omitempty"`
338+
ProtectedCGs []ProtectedCG `json:"protectedCGs,omitempty"`
330339

331340
// Conditions are the list of VRG's summary conditions and their status.
332341
Conditions []metav1.Condition `json:"conditions,omitempty"`

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 55 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/ramendr.openshift.io_drplacementcontrols.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,21 @@ spec:
535535
description: Namespace is the namespace of the Kubernetes
536536
resource.
537537
type: string
538+
protectedcgs:
539+
description: List of CGs that are protected by the VRG resource
540+
items:
541+
description: ProtectedPVCsList defines a group of ProtectedPVCs
542+
properties:
543+
name:
544+
description: Name of the VolRep/PVC resource
545+
type: string
546+
protectedpvcs:
547+
description: All the protected pvcs
548+
items:
549+
type: string
550+
type: array
551+
type: object
552+
type: array
538553
protectedpvcs:
539554
description: List of PVCs that are protected by the VRG resource
540555
items:

0 commit comments

Comments
 (0)