Skip to content

Commit bb238df

Browse files
Merge pull request #2677 from rewantsoni/scp
add new cr and controller for peering
2 parents a6be4c7 + a759b3a commit bb238df

26 files changed

+1519
-7
lines changed

PROJECT

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,13 @@ resources:
5151
kind: StorageRequest
5252
path: github.com/red-hat-storage/ocs-operator/api/v4/v1alpha1
5353
version: v1alpha1
54+
- api:
55+
crdVersion: v1
56+
namespaced: true
57+
controller: true
58+
domain: openshift.io
59+
group: ocs
60+
kind: StorageClusterPeer
61+
path: github.com/red-hat-storage/ocs-operator/api/v4/v1
62+
version: v1
5463
version: "3"

api/v1/groupversion_info.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
4444
&OCSInitialization{}, &OCSInitializationList{},
4545
&StorageCluster{}, &StorageClusterList{},
4646
&StorageProfile{}, &StorageProfileList{},
47+
&StorageClusterPeer{}, &StorageClusterPeerList{},
4748
)
4849
metav1.AddToGroupVersion(scheme, GroupVersion)
4950
return nil

api/v1/storageclusterpeer_types.go

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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+
}

api/v1/zz_generated.deepcopy.go

Lines changed: 159 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)