From 67f473de4d77a74539249faf0e29aaaefde78211 Mon Sep 17 00:00:00 2001 From: rakeshgm Date: Tue, 21 May 2024 18:45:36 +0530 Subject: [PATCH 1/2] extend DRPolicy and VRG spec with PeerClasses Signed-off-by: rakeshgm --- api/v1alpha1/drpolicy_types.go | 43 ++++++++++ api/v1alpha1/volumereplicationgroup_types.go | 16 +++- api/v1alpha1/zz_generated.deepcopy.go | 82 ++++++++++++++++++- .../ramendr.openshift.io_drpolicies.yaml | 62 ++++++++++++++ ..._protectedvolumereplicationgrouplists.yaml | 55 ++++++++++++- ....openshift.io_volumereplicationgroups.yaml | 55 ++++++++++++- 6 files changed, 308 insertions(+), 5 deletions(-) diff --git a/api/v1alpha1/drpolicy_types.go b/api/v1alpha1/drpolicy_types.go index b53a06818..5eee53189 100644 --- a/api/v1alpha1/drpolicy_types.go +++ b/api/v1alpha1/drpolicy_types.go @@ -54,6 +54,49 @@ type DRPolicySpec struct { // DRPolicyStatus defines the observed state of DRPolicy type DRPolicyStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty"` + + // DRPolicyStatus.Async contains the status of observed + // async replication details between the clusters in the policy + //+optional + Async Async `json:"async,omitempty"` + + // DRPolicyStatus.Sync contains the status of observed + // sync replication details between the clusters in the policy + //+optional + Sync Sync `json:"sync,omitempty"` +} + +// for RDR +type Async struct { + // PeerClasses is a list of common StorageClasses across the clusters in a policy + // that have related async relationships. (one per pair of peers in the policy) + //+optional + PeerClasses []PeerClass `json:"peerClasses,omitempty"` +} + +// for MetroDR +type Sync struct { + // PeerClasses is a list of common StorageClasses across the clusters in a policy + // that have related sync relationships. (one per pair of peers in the policy) + //+optional + PeerClasses []PeerClass `json:"peerClasses,omitempty"` +} + +type PeerClass struct { + // ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + // VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + //+optional + ReplicationID string `json:"replicationID,omitempty"` + + // StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + // StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + // and distict if storage instances are different. + //+optional + StorageID []string `json:"storageID,omitempty"` + + // StorageClassName is the name of a StorageClass that is available across the peers + //+optional + StorageClassName string `json:"storageClassName,omitempty"` } const ( diff --git a/api/v1alpha1/volumereplicationgroup_types.go b/api/v1alpha1/volumereplicationgroup_types.go index 964362689..868c2bd20 100644 --- a/api/v1alpha1/volumereplicationgroup_types.go +++ b/api/v1alpha1/volumereplicationgroup_types.go @@ -62,10 +62,22 @@ type VRGAsyncSpec struct { // +kubebuilder:validation:Required // +kubebuilder:validation:Pattern=`^\d+[mhd]$` SchedulingInterval string `json:"schedulingInterval"` + + // PeerClasses is a list of common StorageClasses across the clusters in a policy that have related + // sync relationships. This is ONLY modified post creation, if the workload that is protected + // creates a PVC using a newer StorageClass that is determined to be common across the peers. + //+optional + PeerClasses []PeerClass `json:"peerClasses,omitempty"` } -// VRGSyncSpec has the parameters associated with MetroDR -type VRGSyncSpec struct{} +// VRGSyncSpec has the parameters associated with VE +type VRGSyncSpec struct { + // PeerClasses is a list of common StorageClasses across the clusters in a policy that have related + // async relationships. This is ONLY modified post creation, if the workload that is protected + // creates a PVC using a newer StorageClass that is determined to be common across the peers. + //+optional + PeerClasses []PeerClass `json:"peerClasses,omitempty"` +} // VolSyncReplicationDestinationSpec defines the configuration for the VolSync // protected PVC to be used by the destination cluster (Secondary) diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 59059ff6e..c39af6791 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -14,6 +14,28 @@ import ( configv1alpha1 "k8s.io/component-base/config/v1alpha1" ) +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Async) DeepCopyInto(out *Async) { + *out = *in + if in.PeerClasses != nil { + in, out := &in.PeerClasses, &out.PeerClasses + *out = make([]PeerClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Async. +func (in *Async) DeepCopy() *Async { + if in == nil { + return nil + } + out := new(Async) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ClusterMaintenanceMode) DeepCopyInto(out *ClusterMaintenanceMode) { *out = *in @@ -506,6 +528,8 @@ func (in *DRPolicyStatus) DeepCopyInto(out *DRPolicyStatus) { (*in)[i].DeepCopyInto(&(*out)[i]) } } + in.Async.DeepCopyInto(&out.Async) + in.Sync.DeepCopyInto(&out.Sync) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DRPolicyStatus. @@ -722,6 +746,26 @@ func (in *MaintenanceModeStatus) DeepCopy() *MaintenanceModeStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PeerClass) DeepCopyInto(out *PeerClass) { + *out = *in + if in.StorageID != nil { + in, out := &in.StorageID, &out.StorageID + *out = make([]string, len(*in)) + copy(*out, *in) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerClass. +func (in *PeerClass) DeepCopy() *PeerClass { + if in == nil { + return nil + } + out := new(PeerClass) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PlacementDecision) DeepCopyInto(out *PlacementDecision) { *out = *in @@ -1302,12 +1346,41 @@ func (in *StorageIdentifiers) DeepCopy() *StorageIdentifiers { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *Sync) DeepCopyInto(out *Sync) { + *out = *in + if in.PeerClasses != nil { + in, out := &in.PeerClasses, &out.PeerClasses + *out = make([]PeerClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sync. +func (in *Sync) DeepCopy() *Sync { + if in == nil { + return nil + } + out := new(Sync) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VRGAsyncSpec) DeepCopyInto(out *VRGAsyncSpec) { *out = *in in.ReplicationClassSelector.DeepCopyInto(&out.ReplicationClassSelector) in.VolumeSnapshotClassSelector.DeepCopyInto(&out.VolumeSnapshotClassSelector) in.VolumeGroupSnapshotClassSelector.DeepCopyInto(&out.VolumeGroupSnapshotClassSelector) + if in.PeerClasses != nil { + in, out := &in.PeerClasses, &out.PeerClasses + *out = make([]PeerClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VRGAsyncSpec. @@ -1366,6 +1439,13 @@ func (in *VRGResourceMeta) DeepCopy() *VRGResourceMeta { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VRGSyncSpec) DeepCopyInto(out *VRGSyncSpec) { *out = *in + if in.PeerClasses != nil { + in, out := &in.PeerClasses, &out.PeerClasses + *out = make([]PeerClass, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VRGSyncSpec. @@ -1508,7 +1588,7 @@ func (in *VolumeReplicationGroupSpec) DeepCopyInto(out *VolumeReplicationGroupSp if in.Sync != nil { in, out := &in.Sync, &out.Sync *out = new(VRGSyncSpec) - **out = **in + (*in).DeepCopyInto(*out) } in.VolSync.DeepCopyInto(&out.VolSync) if in.KubeObjectProtection != nil { diff --git a/config/crd/bases/ramendr.openshift.io_drpolicies.yaml b/config/crd/bases/ramendr.openshift.io_drpolicies.yaml index cb51d2c99..e6891873a 100644 --- a/config/crd/bases/ramendr.openshift.io_drpolicies.yaml +++ b/config/crd/bases/ramendr.openshift.io_drpolicies.yaml @@ -222,6 +222,37 @@ spec: status: description: DRPolicyStatus defines the observed state of DRPolicy properties: + async: + description: |- + DRPolicyStatus.Async contains the status of observed + async replication details between the clusters in the policy + properties: + peerClasses: + description: |- + PeerClasses is a list of common StorageClasses across the clusters in a policy + that have related async relationships. (one per pair of peers in the policy) + items: + properties: + replicationID: + description: |- + ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + type: string + storageClassName: + description: StorageClassName is the name of a StorageClass + that is available across the peers + type: string + storageID: + description: |- + StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + and distict if storage instances are different. + items: + type: string + type: array + type: object + type: array + type: object conditions: items: description: "Condition contains details for one aspect of the current @@ -291,6 +322,37 @@ spec: - type type: object type: array + sync: + description: |- + DRPolicyStatus.Sync contains the status of observed + sync replication details between the clusters in the policy + properties: + peerClasses: + description: |- + PeerClasses is a list of common StorageClasses across the clusters in a policy + that have related sync relationships. (one per pair of peers in the policy) + items: + properties: + replicationID: + description: |- + ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + type: string + storageClassName: + description: StorageClassName is the name of a StorageClass + that is available across the peers + type: string + storageID: + description: |- + StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + and distict if storage instances are different. + items: + type: string + type: array + type: object + type: array + type: object type: object type: object served: true diff --git a/config/crd/bases/ramendr.openshift.io_protectedvolumereplicationgrouplists.yaml b/config/crd/bases/ramendr.openshift.io_protectedvolumereplicationgrouplists.yaml index 727101a16..806def40b 100644 --- a/config/crd/bases/ramendr.openshift.io_protectedvolumereplicationgrouplists.yaml +++ b/config/crd/bases/ramendr.openshift.io_protectedvolumereplicationgrouplists.yaml @@ -120,6 +120,32 @@ spec: description: VRGAsyncSpec has the parameters associated with RegionalDR properties: + peerClasses: + description: |- + PeerClasses is a list of common StorageClasses across the clusters in a policy that have related + sync relationships. This is ONLY modified post creation, if the workload that is protected + creates a PVC using a newer StorageClass that is determined to be common across the peers. + items: + properties: + replicationID: + description: |- + ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + type: string + storageClassName: + description: StorageClassName is the name of a + StorageClass that is available across the peers + type: string + storageID: + description: |- + StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + and distict if storage instances are different. + items: + type: string + type: array + type: object + type: array replicationClassSelector: description: |- Label selector to identify the VolumeReplicationClass resources @@ -422,7 +448,34 @@ spec: type: array sync: description: VRGSyncSpec has the parameters associated with - MetroDR + VE + properties: + peerClasses: + description: |- + PeerClasses is a list of common StorageClasses across the clusters in a policy that have related + async relationships. This is ONLY modified post creation, if the workload that is protected + creates a PVC using a newer StorageClass that is determined to be common across the peers. + items: + properties: + replicationID: + description: |- + ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + type: string + storageClassName: + description: StorageClassName is the name of a + StorageClass that is available across the peers + type: string + storageID: + description: |- + StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + and distict if storage instances are different. + items: + type: string + type: array + type: object + type: array type: object volSync: description: volsync defines the configuration when using diff --git a/config/crd/bases/ramendr.openshift.io_volumereplicationgroups.yaml b/config/crd/bases/ramendr.openshift.io_volumereplicationgroups.yaml index 0a8fab00e..c56788a88 100644 --- a/config/crd/bases/ramendr.openshift.io_volumereplicationgroups.yaml +++ b/config/crd/bases/ramendr.openshift.io_volumereplicationgroups.yaml @@ -70,6 +70,32 @@ spec: async: description: VRGAsyncSpec has the parameters associated with RegionalDR properties: + peerClasses: + description: |- + PeerClasses is a list of common StorageClasses across the clusters in a policy that have related + sync relationships. This is ONLY modified post creation, if the workload that is protected + creates a PVC using a newer StorageClass that is determined to be common across the peers. + items: + properties: + replicationID: + description: |- + ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + type: string + storageClassName: + description: StorageClassName is the name of a StorageClass + that is available across the peers + type: string + storageID: + description: |- + StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + and distict if storage instances are different. + items: + type: string + type: array + type: object + type: array replicationClassSelector: description: |- Label selector to identify the VolumeReplicationClass resources @@ -371,7 +397,34 @@ spec: type: string type: array sync: - description: VRGSyncSpec has the parameters associated with MetroDR + description: VRGSyncSpec has the parameters associated with VE + properties: + peerClasses: + description: |- + PeerClasses is a list of common StorageClasses across the clusters in a policy that have related + async relationships. This is ONLY modified post creation, if the workload that is protected + creates a PVC using a newer StorageClass that is determined to be common across the peers. + items: + properties: + replicationID: + description: |- + ReplicationID is the common value for the label "ramendr.openshift.io/replicationID" on the corresponding + VolumeReplicationClass or VolumeGroupReplicationClass on each peer for the matched StorageClassName. + type: string + storageClassName: + description: StorageClassName is the name of a StorageClass + that is available across the peers + type: string + storageID: + description: |- + StorageID is the collection of values for the label "ramendr.openshift.io/storageID" on the corresponding + StorageClassName across the peers. It is singleton if the storage instance is shared across the peers, + and distict if storage instances are different. + items: + type: string + type: array + type: object + type: array type: object volSync: description: volsync defines the configuration when using VolSync From cce257334f37570c46799b47e6f51c39acb2cc3d Mon Sep 17 00:00:00 2001 From: Sheetal Pamecha Date: Thu, 17 Oct 2024 01:29:40 +0530 Subject: [PATCH 2/2] ci: update python version for CI replace 3.13-dev with 3.13 add 3.14-dev remove 3.9 fixes: #1586 Signed-off-by: Sheetal Pamecha --- .github/workflows/ci.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8b99fe290..443242b3f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -115,11 +115,11 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" - - "3.13-dev" + - "3.13" + - "3.14-dev" steps: - name: Checkout source uses: actions/checkout@v4 @@ -184,11 +184,11 @@ jobs: strategy: matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" - - "3.13-dev" + - "3.13" + - "3.14-dev" steps: - name: Checkout source uses: actions/checkout@v4