Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new cr and controller for peering #2677

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions PROJECT
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,13 @@ resources:
kind: StorageRequest
path: github.com/red-hat-storage/ocs-operator/api/v4/v1alpha1
version: v1alpha1
- api:
crdVersion: v1
namespaced: true
controller: true
domain: openshift.io
group: ocs
kind: StorageClusterPeer
path: github.com/red-hat-storage/ocs-operator/api/v4/v1
version: v1
version: "3"
1 change: 1 addition & 0 deletions api/v1/groupversion_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&OCSInitialization{}, &OCSInitializationList{},
&StorageCluster{}, &StorageClusterList{},
&StorageProfile{}, &StorageProfileList{},
&StorageClusterPeer{}, &StorageClusterPeerList{},
)
metav1.AddToGroupVersion(scheme, GroupVersion)
return nil
Expand Down
93 changes: 93 additions & 0 deletions api/v1/storageclusterpeer_types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
/*
Copyright 2020 Red Hat OpenShift Container Storage.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
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"`
}

// 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"`
}

// 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"`
}

// 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"`

// BlockPoolMirroring indicates ceph block mirroring between block pool on the local and remote clusters
//+optional
BlockPoolMirroring *BlockPoolMirroringSpec `json:"blockPoolMirroring,omitempty"`
}

// StorageClusterPeerStatus defines the observed state of StorageClusterPeer
type StorageClusterPeerStatus struct {
}

//+kubebuilder:object:root=true
//+kubebuilder:subresource:status

// StorageClusterPeer is the Schema for the storageclusterpeers API
type StorageClusterPeer struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// +kubebuilder:validation:Required
Spec StorageClusterPeerSpec `json:"spec,omitempty"`
Status StorageClusterPeerStatus `json:"status,omitempty"`
}

//+kubebuilder:object:root=true

// StorageClusterPeerList contains a list of StorageClusterPeer
type StorageClusterPeerList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []StorageClusterPeer `json:"items"`
}
159 changes: 159 additions & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading