From 60c4c9bf9fe7236456c537b5a43119db3b567b54 Mon Sep 17 00:00:00 2001 From: Nikhil-Ladha Date: Mon, 8 Jul 2024 17:46:08 +0530 Subject: [PATCH] config: add generated changes for crds, rbacs add generated changes for crds, rbacs Signed-off-by: Nikhil-Ladha --- .../v1alpha1/zz_generated.deepcopy.go | 6 +++- ...ift.io_volumegroupreplicationcontents.yaml | 22 +++++------- ....openshift.io_volumegroupreplications.yaml | 7 ++-- config/rbac/role.yaml | 35 ++++++++++++++++--- deploy/controller/crds.yaml | 29 +++++++-------- deploy/controller/rbac.yaml | 35 ++++++++++++++++--- 6 files changed, 93 insertions(+), 41 deletions(-) diff --git a/api/replication.storage/v1alpha1/zz_generated.deepcopy.go b/api/replication.storage/v1alpha1/zz_generated.deepcopy.go index 565ae0f63..e97d46cc0 100644 --- a/api/replication.storage/v1alpha1/zz_generated.deepcopy.go +++ b/api/replication.storage/v1alpha1/zz_generated.deepcopy.go @@ -231,7 +231,11 @@ func (in *VolumeGroupReplicationContentSource) DeepCopy() *VolumeGroupReplicatio // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *VolumeGroupReplicationContentSpec) DeepCopyInto(out *VolumeGroupReplicationContentSpec) { *out = *in - out.VolumeGroupReplicationRef = in.VolumeGroupReplicationRef + if in.VolumeGroupReplicationRef != nil { + in, out := &in.VolumeGroupReplicationRef, &out.VolumeGroupReplicationRef + *out = new(corev1.ObjectReference) + **out = **in + } in.Source.DeepCopyInto(&out.Source) } diff --git a/config/crd/bases/replication.storage.openshift.io_volumegroupreplicationcontents.yaml b/config/crd/bases/replication.storage.openshift.io_volumegroupreplicationcontents.yaml index 425c651eb..e2cfd01a8 100644 --- a/config/crd/bases/replication.storage.openshift.io_volumegroupreplicationcontents.yaml +++ b/config/crd/bases/replication.storage.openshift.io_volumegroupreplicationcontents.yaml @@ -52,9 +52,8 @@ spec: type: string source: description: |- - Source specifies whether the snapshot is (or should be) dynamically provisioned + Source specifies whether the volume is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. - This field is immutable after creation. Required. properties: volumeHandles: @@ -71,6 +70,7 @@ spec: description: |- VolumeGroupReplicationClassName is the name of the VolumeGroupReplicationClass from which this group replication was (or will be) created. + Required. type: string volumeGroupReplicationHandle: description: |- @@ -83,10 +83,6 @@ spec: VolumeGroupReplicationContent object is bound. VolumeGroupReplication.Spec.VolumeGroupReplicationContentName field must reference to this VolumeGroupReplicationContent's name for the bidirectional binding to be valid. - For a pre-existing VolumeGroupReplicationContent object, name and namespace of the - VolumeGroupReplication object MUST be provided for binding to happen. - This field is immutable after creation. - Required. properties: apiVersion: description: API version of the referent. @@ -129,16 +125,16 @@ spec: type: object x-kubernetes-map-type: atomic x-kubernetes-validations: - - message: both volumeGroupReplicationRef.name and volumeGroupReplicationRef.namespace - must be set - rule: has(self.name) && has(self.__namespace__) - - message: volumeGroupReplicationRef is immutable - rule: self == oldSelf + - message: volumeGroupReplicationRef.name, volumeGroupReplicationRef.namespace + and volumeGroupReplicationRef.uid must be set if volumeGroupReplicationRef + is defined + rule: 'self != null ? has(self.name) && has(self.__namespace__) + && has(self.uid) : true' required: - provisioner - source + - volumeGroupReplicationClassName - volumeGroupReplicationHandle - - volumeGroupReplicationRef type: object status: description: VolumeGroupReplicationContentStatus defines the status of @@ -146,7 +142,7 @@ spec: properties: persistentVolumeRefList: description: |- - PersistentVolumeRefList is the list of of PV for the group replication + PersistentVolumeRefList is the list of PV for the group replication The maximum number of allowed PV in the group is 100. items: description: |- diff --git a/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml b/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml index 73cc47c9b..bd461e0ca 100644 --- a/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml +++ b/config/crd/bases/replication.storage.openshift.io_volumegroupreplications.yaml @@ -131,11 +131,12 @@ spec: - message: volumeGroupReplicationContentName is immutable rule: self == oldSelf volumeReplicationClassName: - description: volumeReplicationClassName is the volumeReplicationClass - name for VolumeReplication object + description: |- + volumeReplicationClassName is the volumeReplicationClass name for the VolumeReplication object + created for this volumeGroupReplication type: string x-kubernetes-validations: - - message: volumReplicationClassName is immutable + - message: volumeReplicationClassName is immutable rule: self == oldSelf volumeReplicationName: description: Name of the VolumeReplication object created for this diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index e311fe0fc..99fb6aafe 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -8,7 +8,6 @@ rules: - "" resources: - namespaces - - persistentvolumes - pods verbs: - get @@ -30,6 +29,15 @@ rules: - persistentvolumeclaims/finalizers verbs: - update +- apiGroups: + - "" + resources: + - persistentvolumes + verbs: + - get + - list + - update + - watch - apiGroups: - coordination.k8s.io resources: @@ -82,11 +90,19 @@ rules: - get - patch - update +- apiGroups: + - replication.storage.openshift.io + resources: + - volumegroupreplicationclasses + - volumereplicationclasses + verbs: + - get + - list + - watch - apiGroups: - replication.storage.openshift.io resources: - volumegroupreplicationcontents - - volumegroupreplications verbs: - create - delete @@ -101,7 +117,6 @@ rules: - volumegroupreplicationcontents/finalizers - volumegroupreplications/finalizers - volumereplications/finalizers - - volumereplications/status verbs: - update - apiGroups: @@ -116,20 +131,32 @@ rules: - apiGroups: - replication.storage.openshift.io resources: - - volumereplicationclasses + - volumegroupreplications verbs: - get - list + - patch + - update - watch - apiGroups: - replication.storage.openshift.io resources: - volumereplications verbs: + - create + - delete - get - list - update - watch +- apiGroups: + - replication.storage.openshift.io + resources: + - volumereplications/status + verbs: + - get + - list + - update - apiGroups: - storage.k8s.io resources: diff --git a/deploy/controller/crds.yaml b/deploy/controller/crds.yaml index dec6ee0af..5cac931fc 100644 --- a/deploy/controller/crds.yaml +++ b/deploy/controller/crds.yaml @@ -1414,9 +1414,8 @@ spec: type: string source: description: |- - Source specifies whether the snapshot is (or should be) dynamically provisioned + Source specifies whether the volume is (or should be) dynamically provisioned or already exists, and just requires a Kubernetes object representation. - This field is immutable after creation. Required. properties: volumeHandles: @@ -1433,6 +1432,7 @@ spec: description: |- VolumeGroupReplicationClassName is the name of the VolumeGroupReplicationClass from which this group replication was (or will be) created. + Required. type: string volumeGroupReplicationHandle: description: |- @@ -1445,10 +1445,6 @@ spec: VolumeGroupReplicationContent object is bound. VolumeGroupReplication.Spec.VolumeGroupReplicationContentName field must reference to this VolumeGroupReplicationContent's name for the bidirectional binding to be valid. - For a pre-existing VolumeGroupReplicationContent object, name and namespace of the - VolumeGroupReplication object MUST be provided for binding to happen. - This field is immutable after creation. - Required. properties: apiVersion: description: API version of the referent. @@ -1491,16 +1487,16 @@ spec: type: object x-kubernetes-map-type: atomic x-kubernetes-validations: - - message: both volumeGroupReplicationRef.name and volumeGroupReplicationRef.namespace - must be set - rule: has(self.name) && has(self.__namespace__) - - message: volumeGroupReplicationRef is immutable - rule: self == oldSelf + - message: volumeGroupReplicationRef.name, volumeGroupReplicationRef.namespace + and volumeGroupReplicationRef.uid must be set if volumeGroupReplicationRef + is defined + rule: 'self != null ? has(self.name) && has(self.__namespace__) + && has(self.uid) : true' required: - provisioner - source + - volumeGroupReplicationClassName - volumeGroupReplicationHandle - - volumeGroupReplicationRef type: object status: description: VolumeGroupReplicationContentStatus defines the status of @@ -1508,7 +1504,7 @@ spec: properties: persistentVolumeRefList: description: |- - PersistentVolumeRefList is the list of of PV for the group replication + PersistentVolumeRefList is the list of PV for the group replication The maximum number of allowed PV in the group is 100. items: description: |- @@ -1666,11 +1662,12 @@ spec: - message: volumeGroupReplicationContentName is immutable rule: self == oldSelf volumeReplicationClassName: - description: volumeReplicationClassName is the volumeReplicationClass - name for VolumeReplication object + description: |- + volumeReplicationClassName is the volumeReplicationClass name for the VolumeReplication object + created for this volumeGroupReplication type: string x-kubernetes-validations: - - message: volumReplicationClassName is immutable + - message: volumeReplicationClassName is immutable rule: self == oldSelf volumeReplicationName: description: Name of the VolumeReplication object created for this diff --git a/deploy/controller/rbac.yaml b/deploy/controller/rbac.yaml index 54e31b8ce..8a4498228 100644 --- a/deploy/controller/rbac.yaml +++ b/deploy/controller/rbac.yaml @@ -101,7 +101,6 @@ rules: - "" resources: - namespaces - - persistentvolumes - pods verbs: - get @@ -123,6 +122,15 @@ rules: - persistentvolumeclaims/finalizers verbs: - update +- apiGroups: + - "" + resources: + - persistentvolumes + verbs: + - get + - list + - update + - watch - apiGroups: - coordination.k8s.io resources: @@ -175,11 +183,19 @@ rules: - get - patch - update +- apiGroups: + - replication.storage.openshift.io + resources: + - volumegroupreplicationclasses + - volumereplicationclasses + verbs: + - get + - list + - watch - apiGroups: - replication.storage.openshift.io resources: - volumegroupreplicationcontents - - volumegroupreplications verbs: - create - delete @@ -194,7 +210,6 @@ rules: - volumegroupreplicationcontents/finalizers - volumegroupreplications/finalizers - volumereplications/finalizers - - volumereplications/status verbs: - update - apiGroups: @@ -209,20 +224,32 @@ rules: - apiGroups: - replication.storage.openshift.io resources: - - volumereplicationclasses + - volumegroupreplications verbs: - get - list + - patch + - update - watch - apiGroups: - replication.storage.openshift.io resources: - volumereplications verbs: + - create + - delete - get - list - update - watch +- apiGroups: + - replication.storage.openshift.io + resources: + - volumereplications/status + verbs: + - get + - list + - update - apiGroups: - storage.k8s.io resources: