From e7a28f36085c11848e055c81f3e7f8fdb1e0b5a0 Mon Sep 17 00:00:00 2001 From: Rewant Soni Date: Tue, 8 Oct 2024 19:04:07 +0530 Subject: [PATCH 1/2] api: update the storageClusterPeer api Signed-off-by: Rewant Soni --- api/v1/storageclusterpeer_types.go | 46 +++++++++--------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/api/v1/storageclusterpeer_types.go b/api/v1/storageclusterpeer_types.go index 2835574701..6f96db6dcb 100644 --- a/api/v1/storageclusterpeer_types.go +++ b/api/v1/storageclusterpeer_types.go @@ -17,57 +17,37 @@ limitations under the License. package v1 import ( - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -type NamespacedName struct { - Name string `json:"name"` - Namespace string `json:"namespace"` -} - -// RemoteClusterSpec specifies the spec required for the remote cluster -type RemoteClusterSpec struct { - // ApiEndpoint is the URI of the ODF api server - ApiEndpoint string `json:"apiEndpoint"` - - // OnboardingTicket holds an identity information required by the local ODF cluster to onboard. - OnboardingTicket string `json:"onboardingTicket"` - // StorageClusterName holds the namespacedName of the Remote ODF Cluster - StorageClusterName NamespacedName `json:"storageClusterName"` -} +type StorageClusterPeerState string -// LocalClusterSpec specifies the spec required for the local cluster -type LocalClusterSpec struct { - // Name holds the name of the local ODF cluster - Name corev1.LocalObjectReference `json:"name"` -} +const ( + StorageClusterPeerStatePending StorageClusterPeerState = "Pending" + StorageClusterPeerStatePeered StorageClusterPeerState = "Peered" +) -// BlockPoolMirroringSpec enables setting up of mirroring for blockPools in the same namespace. -type BlockPoolMirroringSpec struct { - // Selector is used to select blockPools by label - Selector metav1.LabelSelector `json:"selector"` +type PeerInfo struct { + StorageClusterUid string `json:"storageClusterUid,omitempty"` } // StorageClusterPeerSpec defines the desired state of StorageClusterPeer type StorageClusterPeerSpec struct { - // RemoteCluster specifies the spec required for the remote cluster - RemoteCluster RemoteClusterSpec `json:"remoteCluster"` - - // LocalCluster specifies the spec required for the local cluster - LocalCluster LocalClusterSpec `json:"localCluster"` + // ApiEndpoint is the URI of the ODF api server + ApiEndpoint string `json:"apiEndpoint"` - // BlockPoolMirroring indicates ceph block mirroring between block pool on the local and remote clusters - //+optional - BlockPoolMirroring *BlockPoolMirroringSpec `json:"blockPoolMirroring,omitempty"` + // OnboardingToken holds an identity information required by the local ODF cluster to onboard. + OnboardingToken string `json:"onboardingToken"` } // StorageClusterPeerStatus defines the observed state of StorageClusterPeer type StorageClusterPeerStatus struct { + State StorageClusterPeerState `json:"state,omitempty"` + PeerInfo PeerInfo `json:"peerInfo"` } //+kubebuilder:object:root=true From 73a9335bbd3239b7822be4238010fe4edd8da3ca Mon Sep 17 00:00:00 2001 From: Rewant Soni Date: Tue, 8 Oct 2024 19:05:21 +0530 Subject: [PATCH 2/2] add generated changes Signed-off-by: Rewant Soni --- api/v1/zz_generated.deepcopy.go | 66 +--------- .../ocs.openshift.io_storageclusterpeers.yaml | 123 +++--------------- .../ocs.openshift.io_storageclusterpeers.yaml | 123 +++--------------- .../manifests/storageclusterpeer.crd.yaml | 123 +++--------------- .../api/v4/v1/storageclusterpeer_types.go | 46 ++----- .../api/v4/v1/zz_generated.deepcopy.go | 66 +--------- .../api/v4/v1/storageclusterpeer_types.go | 46 ++----- .../api/v4/v1/zz_generated.deepcopy.go | 66 +--------- 8 files changed, 101 insertions(+), 558 deletions(-) diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index d70f28a85f..83902b8fa8 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -94,22 +94,6 @@ func (in *BlockPoolConfigurationSpec) DeepCopy() *BlockPoolConfigurationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlockPoolMirroringSpec) DeepCopyInto(out *BlockPoolMirroringSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockPoolMirroringSpec. -func (in *BlockPoolMirroringSpec) DeepCopy() *BlockPoolMirroringSpec { - if in == nil { - return nil - } - out := new(BlockPoolMirroringSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIDriverSpec) DeepCopyInto(out *CSIDriverSpec) { *out = *in @@ -272,22 +256,6 @@ func (in *KeyRotationSpec) DeepCopy() *KeyRotationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalClusterSpec) DeepCopyInto(out *LocalClusterSpec) { - *out = *in - out.Name = in.Name -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalClusterSpec. -func (in *LocalClusterSpec) DeepCopy() *LocalClusterSpec { - if in == nil { - return nil - } - out := new(LocalClusterSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManageCephBlockPools) DeepCopyInto(out *ManageCephBlockPools) { *out = *in @@ -595,21 +563,6 @@ func (in *NFSSpec) DeepCopy() *NFSSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacedName) DeepCopyInto(out *NamespacedName) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedName. -func (in *NamespacedName) DeepCopy() *NamespacedName { - if in == nil { - return nil - } - out := new(NamespacedName) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeTopologyMap) DeepCopyInto(out *NodeTopologyMap) { *out = *in @@ -768,17 +721,16 @@ func (in *OverprovisionControlSpec) DeepCopy() *OverprovisionControlSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RemoteClusterSpec) DeepCopyInto(out *RemoteClusterSpec) { +func (in *PeerInfo) DeepCopyInto(out *PeerInfo) { *out = *in - out.StorageClusterName = in.StorageClusterName } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteClusterSpec. -func (in *RemoteClusterSpec) DeepCopy() *RemoteClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerInfo. +func (in *PeerInfo) DeepCopy() *PeerInfo { if in == nil { return nil } - out := new(RemoteClusterSpec) + out := new(PeerInfo) in.DeepCopyInto(out) return out } @@ -884,7 +836,7 @@ func (in *StorageClusterPeer) DeepCopyInto(out *StorageClusterPeer) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec out.Status = in.Status } @@ -941,13 +893,6 @@ func (in *StorageClusterPeerList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageClusterPeerSpec) DeepCopyInto(out *StorageClusterPeerSpec) { *out = *in - out.RemoteCluster = in.RemoteCluster - out.LocalCluster = in.LocalCluster - if in.BlockPoolMirroring != nil { - in, out := &in.BlockPoolMirroring, &out.BlockPoolMirroring - *out = new(BlockPoolMirroringSpec) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterPeerSpec. @@ -963,6 +908,7 @@ func (in *StorageClusterPeerSpec) DeepCopy() *StorageClusterPeerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageClusterPeerStatus) DeepCopyInto(out *StorageClusterPeerStatus) { *out = *in + out.PeerInfo = in.PeerInfo } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterPeerStatus. diff --git a/config/crd/bases/ocs.openshift.io_storageclusterpeers.yaml b/config/crd/bases/ocs.openshift.io_storageclusterpeers.yaml index 3c97d8e6db..5bbd23f480 100644 --- a/config/crd/bases/ocs.openshift.io_storageclusterpeers.yaml +++ b/config/crd/bases/ocs.openshift.io_storageclusterpeers.yaml @@ -40,114 +40,29 @@ spec: spec: description: StorageClusterPeerSpec defines the desired state of StorageClusterPeer properties: - blockPoolMirroring: - description: BlockPoolMirroring indicates ceph block mirroring between - block pool on the local and remote clusters - properties: - selector: - description: Selector is used to select blockPools by label - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - selector - type: object - localCluster: - description: LocalCluster specifies the spec required for the local - cluster - properties: - name: - description: Name holds the name of the local ODF cluster - 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. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - required: - - name - type: object - remoteCluster: - description: RemoteCluster specifies the spec required for the remote - cluster - properties: - apiEndpoint: - description: ApiEndpoint is the URI of the ODF api server - type: string - onboardingTicket: - description: OnboardingTicket holds an identity information required - by the local ODF cluster to onboard. - type: string - storageClusterName: - description: StorageClusterName holds the namespacedName of the - Remote ODF Cluster - properties: - name: - type: string - namespace: - type: string - required: - - name - - namespace - type: object - required: - - apiEndpoint - - onboardingTicket - - storageClusterName - type: object + apiEndpoint: + description: ApiEndpoint is the URI of the ODF api server + type: string + onboardingToken: + description: OnboardingToken holds an identity information required + by the local ODF cluster to onboard. + type: string required: - - localCluster - - remoteCluster + - apiEndpoint + - onboardingToken type: object status: description: StorageClusterPeerStatus defines the observed state of StorageClusterPeer + properties: + peerInfo: + properties: + storageClusterUid: + type: string + type: object + state: + type: string + required: + - peerInfo type: object required: - spec diff --git a/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusterpeers.yaml b/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusterpeers.yaml index 3c97d8e6db..5bbd23f480 100644 --- a/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusterpeers.yaml +++ b/deploy/csv-templates/crds/ocs/ocs.openshift.io_storageclusterpeers.yaml @@ -40,114 +40,29 @@ spec: spec: description: StorageClusterPeerSpec defines the desired state of StorageClusterPeer properties: - blockPoolMirroring: - description: BlockPoolMirroring indicates ceph block mirroring between - block pool on the local and remote clusters - properties: - selector: - description: Selector is used to select blockPools by label - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - selector - type: object - localCluster: - description: LocalCluster specifies the spec required for the local - cluster - properties: - name: - description: Name holds the name of the local ODF cluster - 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. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - required: - - name - type: object - remoteCluster: - description: RemoteCluster specifies the spec required for the remote - cluster - properties: - apiEndpoint: - description: ApiEndpoint is the URI of the ODF api server - type: string - onboardingTicket: - description: OnboardingTicket holds an identity information required - by the local ODF cluster to onboard. - type: string - storageClusterName: - description: StorageClusterName holds the namespacedName of the - Remote ODF Cluster - properties: - name: - type: string - namespace: - type: string - required: - - name - - namespace - type: object - required: - - apiEndpoint - - onboardingTicket - - storageClusterName - type: object + apiEndpoint: + description: ApiEndpoint is the URI of the ODF api server + type: string + onboardingToken: + description: OnboardingToken holds an identity information required + by the local ODF cluster to onboard. + type: string required: - - localCluster - - remoteCluster + - apiEndpoint + - onboardingToken type: object status: description: StorageClusterPeerStatus defines the observed state of StorageClusterPeer + properties: + peerInfo: + properties: + storageClusterUid: + type: string + type: object + state: + type: string + required: + - peerInfo type: object required: - spec diff --git a/deploy/ocs-operator/manifests/storageclusterpeer.crd.yaml b/deploy/ocs-operator/manifests/storageclusterpeer.crd.yaml index 3c97d8e6db..5bbd23f480 100644 --- a/deploy/ocs-operator/manifests/storageclusterpeer.crd.yaml +++ b/deploy/ocs-operator/manifests/storageclusterpeer.crd.yaml @@ -40,114 +40,29 @@ spec: spec: description: StorageClusterPeerSpec defines the desired state of StorageClusterPeer properties: - blockPoolMirroring: - description: BlockPoolMirroring indicates ceph block mirroring between - block pool on the local and remote clusters - properties: - selector: - description: Selector is used to select blockPools by label - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: |- - A label selector requirement is a selector that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: |- - operator represents a key's relationship to a set of values. - Valid operators are In, NotIn, Exists and DoesNotExist. - type: string - values: - description: |- - values is an array of string values. If the operator is In or NotIn, - the values array must be non-empty. If the operator is Exists or DoesNotExist, - the values array must be empty. This array is replaced during a strategic - merge patch. - items: - type: string - type: array - x-kubernetes-list-type: atomic - required: - - key - - operator - type: object - type: array - x-kubernetes-list-type: atomic - matchLabels: - additionalProperties: - type: string - description: |- - matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, whose key field is "key", the - operator is "In", and the values array contains only "value". The requirements are ANDed. - type: object - type: object - x-kubernetes-map-type: atomic - required: - - selector - type: object - localCluster: - description: LocalCluster specifies the spec required for the local - cluster - properties: - name: - description: Name holds the name of the local ODF cluster - 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. - More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - type: string - type: object - x-kubernetes-map-type: atomic - required: - - name - type: object - remoteCluster: - description: RemoteCluster specifies the spec required for the remote - cluster - properties: - apiEndpoint: - description: ApiEndpoint is the URI of the ODF api server - type: string - onboardingTicket: - description: OnboardingTicket holds an identity information required - by the local ODF cluster to onboard. - type: string - storageClusterName: - description: StorageClusterName holds the namespacedName of the - Remote ODF Cluster - properties: - name: - type: string - namespace: - type: string - required: - - name - - namespace - type: object - required: - - apiEndpoint - - onboardingTicket - - storageClusterName - type: object + apiEndpoint: + description: ApiEndpoint is the URI of the ODF api server + type: string + onboardingToken: + description: OnboardingToken holds an identity information required + by the local ODF cluster to onboard. + type: string required: - - localCluster - - remoteCluster + - apiEndpoint + - onboardingToken type: object status: description: StorageClusterPeerStatus defines the observed state of StorageClusterPeer + properties: + peerInfo: + properties: + storageClusterUid: + type: string + type: object + state: + type: string + required: + - peerInfo type: object required: - spec diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go index 2835574701..6f96db6dcb 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go @@ -17,57 +17,37 @@ limitations under the License. package v1 import ( - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -type NamespacedName struct { - Name string `json:"name"` - Namespace string `json:"namespace"` -} - -// RemoteClusterSpec specifies the spec required for the remote cluster -type RemoteClusterSpec struct { - // ApiEndpoint is the URI of the ODF api server - ApiEndpoint string `json:"apiEndpoint"` - - // OnboardingTicket holds an identity information required by the local ODF cluster to onboard. - OnboardingTicket string `json:"onboardingTicket"` - // StorageClusterName holds the namespacedName of the Remote ODF Cluster - StorageClusterName NamespacedName `json:"storageClusterName"` -} +type StorageClusterPeerState string -// LocalClusterSpec specifies the spec required for the local cluster -type LocalClusterSpec struct { - // Name holds the name of the local ODF cluster - Name corev1.LocalObjectReference `json:"name"` -} +const ( + StorageClusterPeerStatePending StorageClusterPeerState = "Pending" + StorageClusterPeerStatePeered StorageClusterPeerState = "Peered" +) -// BlockPoolMirroringSpec enables setting up of mirroring for blockPools in the same namespace. -type BlockPoolMirroringSpec struct { - // Selector is used to select blockPools by label - Selector metav1.LabelSelector `json:"selector"` +type PeerInfo struct { + StorageClusterUid string `json:"storageClusterUid,omitempty"` } // StorageClusterPeerSpec defines the desired state of StorageClusterPeer type StorageClusterPeerSpec struct { - // RemoteCluster specifies the spec required for the remote cluster - RemoteCluster RemoteClusterSpec `json:"remoteCluster"` - - // LocalCluster specifies the spec required for the local cluster - LocalCluster LocalClusterSpec `json:"localCluster"` + // ApiEndpoint is the URI of the ODF api server + ApiEndpoint string `json:"apiEndpoint"` - // BlockPoolMirroring indicates ceph block mirroring between block pool on the local and remote clusters - //+optional - BlockPoolMirroring *BlockPoolMirroringSpec `json:"blockPoolMirroring,omitempty"` + // OnboardingToken holds an identity information required by the local ODF cluster to onboard. + OnboardingToken string `json:"onboardingToken"` } // StorageClusterPeerStatus defines the observed state of StorageClusterPeer type StorageClusterPeerStatus struct { + State StorageClusterPeerState `json:"state,omitempty"` + PeerInfo PeerInfo `json:"peerInfo"` } //+kubebuilder:object:root=true diff --git a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go index d70f28a85f..83902b8fa8 100644 --- a/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go +++ b/metrics/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go @@ -94,22 +94,6 @@ func (in *BlockPoolConfigurationSpec) DeepCopy() *BlockPoolConfigurationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlockPoolMirroringSpec) DeepCopyInto(out *BlockPoolMirroringSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockPoolMirroringSpec. -func (in *BlockPoolMirroringSpec) DeepCopy() *BlockPoolMirroringSpec { - if in == nil { - return nil - } - out := new(BlockPoolMirroringSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIDriverSpec) DeepCopyInto(out *CSIDriverSpec) { *out = *in @@ -272,22 +256,6 @@ func (in *KeyRotationSpec) DeepCopy() *KeyRotationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalClusterSpec) DeepCopyInto(out *LocalClusterSpec) { - *out = *in - out.Name = in.Name -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalClusterSpec. -func (in *LocalClusterSpec) DeepCopy() *LocalClusterSpec { - if in == nil { - return nil - } - out := new(LocalClusterSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManageCephBlockPools) DeepCopyInto(out *ManageCephBlockPools) { *out = *in @@ -595,21 +563,6 @@ func (in *NFSSpec) DeepCopy() *NFSSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacedName) DeepCopyInto(out *NamespacedName) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedName. -func (in *NamespacedName) DeepCopy() *NamespacedName { - if in == nil { - return nil - } - out := new(NamespacedName) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeTopologyMap) DeepCopyInto(out *NodeTopologyMap) { *out = *in @@ -768,17 +721,16 @@ func (in *OverprovisionControlSpec) DeepCopy() *OverprovisionControlSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RemoteClusterSpec) DeepCopyInto(out *RemoteClusterSpec) { +func (in *PeerInfo) DeepCopyInto(out *PeerInfo) { *out = *in - out.StorageClusterName = in.StorageClusterName } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteClusterSpec. -func (in *RemoteClusterSpec) DeepCopy() *RemoteClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerInfo. +func (in *PeerInfo) DeepCopy() *PeerInfo { if in == nil { return nil } - out := new(RemoteClusterSpec) + out := new(PeerInfo) in.DeepCopyInto(out) return out } @@ -884,7 +836,7 @@ func (in *StorageClusterPeer) DeepCopyInto(out *StorageClusterPeer) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec out.Status = in.Status } @@ -941,13 +893,6 @@ func (in *StorageClusterPeerList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageClusterPeerSpec) DeepCopyInto(out *StorageClusterPeerSpec) { *out = *in - out.RemoteCluster = in.RemoteCluster - out.LocalCluster = in.LocalCluster - if in.BlockPoolMirroring != nil { - in, out := &in.BlockPoolMirroring, &out.BlockPoolMirroring - *out = new(BlockPoolMirroringSpec) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterPeerSpec. @@ -963,6 +908,7 @@ func (in *StorageClusterPeerSpec) DeepCopy() *StorageClusterPeerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageClusterPeerStatus) DeepCopyInto(out *StorageClusterPeerStatus) { *out = *in + out.PeerInfo = in.PeerInfo } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterPeerStatus. diff --git a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go index 2835574701..6f96db6dcb 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/storageclusterpeer_types.go @@ -17,57 +17,37 @@ limitations under the License. package v1 import ( - corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! // NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. -type NamespacedName struct { - Name string `json:"name"` - Namespace string `json:"namespace"` -} - -// RemoteClusterSpec specifies the spec required for the remote cluster -type RemoteClusterSpec struct { - // ApiEndpoint is the URI of the ODF api server - ApiEndpoint string `json:"apiEndpoint"` - - // OnboardingTicket holds an identity information required by the local ODF cluster to onboard. - OnboardingTicket string `json:"onboardingTicket"` - // StorageClusterName holds the namespacedName of the Remote ODF Cluster - StorageClusterName NamespacedName `json:"storageClusterName"` -} +type StorageClusterPeerState string -// LocalClusterSpec specifies the spec required for the local cluster -type LocalClusterSpec struct { - // Name holds the name of the local ODF cluster - Name corev1.LocalObjectReference `json:"name"` -} +const ( + StorageClusterPeerStatePending StorageClusterPeerState = "Pending" + StorageClusterPeerStatePeered StorageClusterPeerState = "Peered" +) -// BlockPoolMirroringSpec enables setting up of mirroring for blockPools in the same namespace. -type BlockPoolMirroringSpec struct { - // Selector is used to select blockPools by label - Selector metav1.LabelSelector `json:"selector"` +type PeerInfo struct { + StorageClusterUid string `json:"storageClusterUid,omitempty"` } // StorageClusterPeerSpec defines the desired state of StorageClusterPeer type StorageClusterPeerSpec struct { - // RemoteCluster specifies the spec required for the remote cluster - RemoteCluster RemoteClusterSpec `json:"remoteCluster"` - - // LocalCluster specifies the spec required for the local cluster - LocalCluster LocalClusterSpec `json:"localCluster"` + // ApiEndpoint is the URI of the ODF api server + ApiEndpoint string `json:"apiEndpoint"` - // BlockPoolMirroring indicates ceph block mirroring between block pool on the local and remote clusters - //+optional - BlockPoolMirroring *BlockPoolMirroringSpec `json:"blockPoolMirroring,omitempty"` + // OnboardingToken holds an identity information required by the local ODF cluster to onboard. + OnboardingToken string `json:"onboardingToken"` } // StorageClusterPeerStatus defines the observed state of StorageClusterPeer type StorageClusterPeerStatus struct { + State StorageClusterPeerState `json:"state,omitempty"` + PeerInfo PeerInfo `json:"peerInfo"` } //+kubebuilder:object:root=true diff --git a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go index d70f28a85f..83902b8fa8 100644 --- a/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/red-hat-storage/ocs-operator/api/v4/v1/zz_generated.deepcopy.go @@ -94,22 +94,6 @@ func (in *BlockPoolConfigurationSpec) DeepCopy() *BlockPoolConfigurationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BlockPoolMirroringSpec) DeepCopyInto(out *BlockPoolMirroringSpec) { - *out = *in - in.Selector.DeepCopyInto(&out.Selector) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BlockPoolMirroringSpec. -func (in *BlockPoolMirroringSpec) DeepCopy() *BlockPoolMirroringSpec { - if in == nil { - return nil - } - out := new(BlockPoolMirroringSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CSIDriverSpec) DeepCopyInto(out *CSIDriverSpec) { *out = *in @@ -272,22 +256,6 @@ func (in *KeyRotationSpec) DeepCopy() *KeyRotationSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *LocalClusterSpec) DeepCopyInto(out *LocalClusterSpec) { - *out = *in - out.Name = in.Name -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalClusterSpec. -func (in *LocalClusterSpec) DeepCopy() *LocalClusterSpec { - if in == nil { - return nil - } - out := new(LocalClusterSpec) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManageCephBlockPools) DeepCopyInto(out *ManageCephBlockPools) { *out = *in @@ -595,21 +563,6 @@ func (in *NFSSpec) DeepCopy() *NFSSpec { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NamespacedName) DeepCopyInto(out *NamespacedName) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NamespacedName. -func (in *NamespacedName) DeepCopy() *NamespacedName { - if in == nil { - return nil - } - out := new(NamespacedName) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeTopologyMap) DeepCopyInto(out *NodeTopologyMap) { *out = *in @@ -768,17 +721,16 @@ func (in *OverprovisionControlSpec) DeepCopy() *OverprovisionControlSpec { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *RemoteClusterSpec) DeepCopyInto(out *RemoteClusterSpec) { +func (in *PeerInfo) DeepCopyInto(out *PeerInfo) { *out = *in - out.StorageClusterName = in.StorageClusterName } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RemoteClusterSpec. -func (in *RemoteClusterSpec) DeepCopy() *RemoteClusterSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PeerInfo. +func (in *PeerInfo) DeepCopy() *PeerInfo { if in == nil { return nil } - out := new(RemoteClusterSpec) + out := new(PeerInfo) in.DeepCopyInto(out) return out } @@ -884,7 +836,7 @@ func (in *StorageClusterPeer) DeepCopyInto(out *StorageClusterPeer) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec out.Status = in.Status } @@ -941,13 +893,6 @@ func (in *StorageClusterPeerList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageClusterPeerSpec) DeepCopyInto(out *StorageClusterPeerSpec) { *out = *in - out.RemoteCluster = in.RemoteCluster - out.LocalCluster = in.LocalCluster - if in.BlockPoolMirroring != nil { - in, out := &in.BlockPoolMirroring, &out.BlockPoolMirroring - *out = new(BlockPoolMirroringSpec) - (*in).DeepCopyInto(*out) - } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterPeerSpec. @@ -963,6 +908,7 @@ func (in *StorageClusterPeerSpec) DeepCopy() *StorageClusterPeerSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *StorageClusterPeerStatus) DeepCopyInto(out *StorageClusterPeerStatus) { *out = *in + out.PeerInfo = in.PeerInfo } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClusterPeerStatus.