From e3878f5a6266b920e77cf5fd57918fdedc1f165b Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 20 Jun 2024 16:08:00 +0200 Subject: [PATCH] replication: add pvcRef to volumegroupreplication adding the pvcRef to the volumegroupreplication to give a representation of the pvc's which are part of the volumegroupreplication. Signed-off-by: Madhu Rajanna --- .../v1alpha1/volumegroupreplication_types.go | 5 ++++ .../v1alpha1/zz_generated.deepcopy.go | 5 ++++ ....openshift.io_volumegroupreplications.yaml | 23 +++++++++++++++++++ deploy/controller/crds.yaml | 23 +++++++++++++++++++ 4 files changed, 56 insertions(+) diff --git a/apis/replication.storage/v1alpha1/volumegroupreplication_types.go b/apis/replication.storage/v1alpha1/volumegroupreplication_types.go index 04aac01cb..8ad2bff70 100644 --- a/apis/replication.storage/v1alpha1/volumegroupreplication_types.go +++ b/apis/replication.storage/v1alpha1/volumegroupreplication_types.go @@ -17,6 +17,7 @@ limitations under the License. package v1alpha1 import ( + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -72,6 +73,10 @@ type VolumeGroupReplicationSource struct { // VolumeGroupReplicationStatus defines the observed state of VolumeGroupReplication type VolumeGroupReplicationStatus struct { VolumeReplicationStatus `json:",inline"` + // PersistentVolumeClaimsRefList is the list of PVCs for the volume group replication. + // The maximum number of allowed PVCs in the group is 100. + // +optional + PersistentVolumeClaimsRefList []corev1.LocalObjectReference `json:"persistentVolumeClaimsRefList,omitempty"` } //+kubebuilder:object:root=true diff --git a/apis/replication.storage/v1alpha1/zz_generated.deepcopy.go b/apis/replication.storage/v1alpha1/zz_generated.deepcopy.go index 250903db7..dcfe62b46 100644 --- a/apis/replication.storage/v1alpha1/zz_generated.deepcopy.go +++ b/apis/replication.storage/v1alpha1/zz_generated.deepcopy.go @@ -337,6 +337,11 @@ func (in *VolumeGroupReplicationSpec) DeepCopy() *VolumeGroupReplicationSpec { func (in *VolumeGroupReplicationStatus) DeepCopyInto(out *VolumeGroupReplicationStatus) { *out = *in in.VolumeReplicationStatus.DeepCopyInto(&out.VolumeReplicationStatus) + if in.PersistentVolumeClaimsRefList != nil { + in, out := &in.PersistentVolumeClaimsRefList, &out.PersistentVolumeClaimsRefList + *out = make([]corev1.LocalObjectReference, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeGroupReplicationStatus. diff --git a/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml b/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml index d8f5757cb..d111784b4 100644 --- a/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml +++ b/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml @@ -246,6 +246,29 @@ spec: operator has dealt with format: int64 type: integer + persistentVolumeClaimsRefList: + description: |- + PersistentVolumeClaimsRefList is the list of PVCs for the volume group replication. + The maximum number of allowed PVCs in the group is 100. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + TODO: Add other useful fields. apiVersion, kind, uid? + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + type: string + type: object + x-kubernetes-map-type: atomic + type: array state: description: State captures the latest state of the replication operation. type: string diff --git a/deploy/controller/crds.yaml b/deploy/controller/crds.yaml index 2f035c81c..6d218de9f 100644 --- a/deploy/controller/crds.yaml +++ b/deploy/controller/crds.yaml @@ -1269,6 +1269,29 @@ spec: operator has dealt with format: int64 type: integer + persistentVolumeClaimsRefList: + description: |- + PersistentVolumeClaimsRefList is the list of PVCs for the volume group replication. + The maximum number of allowed PVCs in the group is 100. + items: + description: |- + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + properties: + name: + default: "" + description: |- + Name of the referent. + This field is effectively required, but due to backwards compatibility is + allowed to be empty. Instances of this type with an empty value here are + almost certainly wrong. + TODO: Add other useful fields. apiVersion, kind, uid? + More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + type: string + type: object + x-kubernetes-map-type: atomic + type: array state: description: State captures the latest state of the replication operation. type: string