|
| 1 | +/* |
| 2 | +Copyright 2020 Red Hat OpenShift Container Storage. |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +package v1 |
| 18 | + |
| 19 | +import ( |
| 20 | + corev1 "k8s.io/api/core/v1" |
| 21 | + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" |
| 22 | +) |
| 23 | + |
| 24 | +// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN! |
| 25 | +// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized. |
| 26 | +type NamespacedName struct { |
| 27 | + Name string `json:"name"` |
| 28 | + Namespace string `json:"namespace"` |
| 29 | +} |
| 30 | + |
| 31 | +// RemoteClusterSpec specifies the spec required for the remote cluster |
| 32 | +type RemoteClusterSpec struct { |
| 33 | + // ApiEndpoint is the URI of the ODF api server |
| 34 | + ApiEndpoint string `json:"apiEndpoint"` |
| 35 | + |
| 36 | + // OnboardingTicket holds an identity information required by the local ODF cluster to onboard. |
| 37 | + OnboardingTicket string `json:"onboardingTicket"` |
| 38 | + |
| 39 | + // StorageClusterName holds the namespacedName of the Remote ODF Cluster |
| 40 | + StorageClusterName NamespacedName `json:"storageClusterName"` |
| 41 | +} |
| 42 | + |
| 43 | +// LocalClusterSpec specifies the spec required for the local cluster |
| 44 | +type LocalClusterSpec struct { |
| 45 | + // Name holds the name of the local ODF cluster |
| 46 | + Name corev1.LocalObjectReference `json:"name"` |
| 47 | +} |
| 48 | + |
| 49 | +// BlockPoolMirroringSpec enables setting up of mirroring for blockPools in the same namespace. |
| 50 | +type BlockPoolMirroringSpec struct { |
| 51 | + // Selector is used to select blockPools by label |
| 52 | + Selector metav1.LabelSelector `json:"selector"` |
| 53 | +} |
| 54 | + |
| 55 | +// StorageClusterPeerSpec defines the desired state of StorageClusterPeer |
| 56 | +type StorageClusterPeerSpec struct { |
| 57 | + |
| 58 | + // RemoteCluster specifies the spec required for the remote cluster |
| 59 | + RemoteCluster RemoteClusterSpec `json:"remoteCluster"` |
| 60 | + |
| 61 | + // LocalCluster specifies the spec required for the local cluster |
| 62 | + LocalCluster LocalClusterSpec `json:"localCluster"` |
| 63 | + |
| 64 | + // BlockPoolMirroring indicates ceph block mirroring between block pool on the local and remote clusters |
| 65 | + //+optional |
| 66 | + BlockPoolMirroring *BlockPoolMirroringSpec `json:"blockPoolMirroring,omitempty"` |
| 67 | +} |
| 68 | + |
| 69 | +// StorageClusterPeerStatus defines the observed state of StorageClusterPeer |
| 70 | +type StorageClusterPeerStatus struct { |
| 71 | +} |
| 72 | + |
| 73 | +//+kubebuilder:object:root=true |
| 74 | +//+kubebuilder:subresource:status |
| 75 | + |
| 76 | +// StorageClusterPeer is the Schema for the storageclusterpeers API |
| 77 | +type StorageClusterPeer struct { |
| 78 | + metav1.TypeMeta `json:",inline"` |
| 79 | + metav1.ObjectMeta `json:"metadata,omitempty"` |
| 80 | + |
| 81 | + // +kubebuilder:validation:Required |
| 82 | + Spec StorageClusterPeerSpec `json:"spec,omitempty"` |
| 83 | + Status StorageClusterPeerStatus `json:"status,omitempty"` |
| 84 | +} |
| 85 | + |
| 86 | +//+kubebuilder:object:root=true |
| 87 | + |
| 88 | +// StorageClusterPeerList contains a list of StorageClusterPeer |
| 89 | +type StorageClusterPeerList struct { |
| 90 | + metav1.TypeMeta `json:",inline"` |
| 91 | + metav1.ListMeta `json:"metadata,omitempty"` |
| 92 | + Items []StorageClusterPeer `json:"items"` |
| 93 | +} |
0 commit comments