Skip to content

Commit

Permalink
Add CG support to VolumeReplicationGroupStatus and VRGResourceMeta.
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <[email protected]>
  • Loading branch information
ELENAGER committed Nov 14, 2024
1 parent b8b94ca commit 9af300c
Show file tree
Hide file tree
Showing 12 changed files with 880 additions and 131 deletions.
14 changes: 14 additions & 0 deletions api/v1alpha1/drplacementcontrol_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ type PlacementDecision struct {
ClusterNamespace string `json:"clusterNamespace,omitempty"`
}

// ProtectedPVCsList defines a group of ProtectedPVCs
type ProtectedPVCsList struct {
// Name of the VolRep/PVC resource
//+optional
Name string `json:"name,omitempty"`

// All the protected pvcs
ProtectedPVCs []string `json:"protectedpvcs,omitempty"`
}

// VRGResourceMeta represents the VRG resource.
type VRGResourceMeta struct {
// Kind is the kind of the Kubernetes resource.
Expand All @@ -185,6 +195,10 @@ type VRGResourceMeta struct {
//+optional
ProtectedPVCs []string `json:"protectedpvcs,omitempty"`

// List of CGs that are protected by the VRG resource
//+optional
ProtectedCGs []ProtectedPVCsList `json:"protectedcgs,omitempty"`

// ResourceVersion is a value used to identify the version of the
// VRG resource object
//+optional
Expand Down
11 changes: 10 additions & 1 deletion api/v1alpha1/volumereplicationgroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,14 @@ type ProtectedPVC struct {
VolumeMode *corev1.PersistentVolumeMode `json:"volumeMode,omitempty"`
}

// ProtectedCG defines a group of ProtectedPVCs
type ProtectedCG struct {
ProtectedPVC `json:",inline"`

// List the protected pvcs names
PVCs []string `json:"protectedPVCs,omitempty"`
}

type KubeObjectsCaptureIdentifier struct {
Number int64 `json:"number"`
//+nullable
Expand All @@ -325,8 +333,9 @@ type KubeObjectProtectionStatus struct {
type VolumeReplicationGroupStatus struct {
State State `json:"state,omitempty"`

// All the protected pvcs
// One of ProtectedPVCs or ProtectedCGs must be set
ProtectedPVCs []ProtectedPVC `json:"protectedPVCs,omitempty"`
ProtectedCGs []ProtectedCG `json:"protectedCGs,omitempty"`

// Conditions are the list of VRG's summary conditions and their status.
Conditions []metav1.Condition `json:"conditions,omitempty"`
Expand Down
55 changes: 55 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions config/crd/bases/ramendr.openshift.io_drplacementcontrols.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,21 @@ spec:
description: Namespace is the namespace of the Kubernetes
resource.
type: string
protectedcgs:
description: List of CGs that are protected by the VRG resource
items:
description: ProtectedPVCsList defines a group of ProtectedPVCs
properties:
name:
description: Name of the VolRep/PVC resource
type: string
protectedpvcs:
description: All the protected pvcs
items:
type: string
type: array
type: object
type: array
protectedpvcs:
description: List of PVCs that are protected by the VRG resource
items:
Expand Down
Loading

0 comments on commit 9af300c

Please sign in to comment.