forked from csi-addons/kubernetes-csi-addons
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #153 from red-hat-storage/sync_us--main
Syncing latest changes from upstream main for kubernetes-csi-addons
- Loading branch information
Showing
79 changed files
with
2,837 additions
and
634 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
apis/replication.storage/v1alpha1/volumegroupreplication_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
/* | ||
Copyright 2024 The Kubernetes-CSI-Addons Authors. | ||
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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// VolumeGroupReplicationSpec defines the desired state of VolumeGroupReplication | ||
type VolumeGroupReplicationSpec struct { | ||
// volumeGroupReplicationClassName is the volumeGroupReplicationClass name for this VolumeGroupReplication resource | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeGroupReplicationClassName is immutable" | ||
VolumeGroupReplicationClassName string `json:"volumeGroupReplicationClassName"` | ||
|
||
// Name of the VolumeReplication object created for this volumeGroupReplication | ||
// +kubebuilder:validation:Optional | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeReplicationName is immutable" | ||
VolumeReplicationName string `json:"volumeReplicationName,omitempty"` | ||
|
||
// Name of the VolumeGroupReplicationContent object created for this volumeGroupReplication | ||
// +kubebuilder:validation:Optional | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeGroupReplicationContentName is immutable" | ||
VolumeGroupReplicationContentName string `json:"volumeGroupReplicationContentName,omitempty"` | ||
|
||
// Source specifies where a group replications will be created from. | ||
// This field is immutable after creation. | ||
// Required. | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="source is immutable" | ||
Source VolumeGroupReplicationSource `json:"source"` | ||
|
||
// ReplicationState represents the replication operation to be performed on the group. | ||
// Supported operations are "primary", "secondary" and "resync" | ||
// +kubebuilder:validation:Required | ||
ReplicationState ReplicationState `json:"replicationState"` | ||
|
||
// AutoResync represents the group to be auto resynced when | ||
// ReplicationState is "secondary" | ||
// +kubebuilder:default:=false | ||
AutoResync bool `json:"autoResync"` | ||
} | ||
|
||
// VolumeGroupReplicationSource specifies the source for the the volumeGroupReplication | ||
type VolumeGroupReplicationSource struct { | ||
// Selector is a label query over persistent volume claims that are to be | ||
// grouped together for replication. | ||
// +optional | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="selector is immutable" | ||
Selector *metav1.LabelSelector `json:"selector,omitempty"` | ||
} | ||
|
||
// VolumeGroupReplicationStatus defines the observed state of VolumeGroupReplication | ||
type VolumeGroupReplicationStatus struct { | ||
VolumeReplicationStatus `json:",inline"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// VolumeGroupReplication is the Schema for the volumegroupreplications API | ||
type VolumeGroupReplication struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec VolumeGroupReplicationSpec `json:"spec,omitempty"` | ||
Status VolumeGroupReplicationStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// VolumeGroupReplicationList contains a list of VolumeGroupReplication | ||
type VolumeGroupReplicationList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []VolumeGroupReplication `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&VolumeGroupReplication{}, &VolumeGroupReplicationList{}) | ||
} |
67 changes: 67 additions & 0 deletions
67
apis/replication.storage/v1alpha1/volumegroupreplicationclass_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
Copyright 2024 The Kubernetes-CSI-Addons Authors. | ||
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 v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// VolumeGroupReplicationClassSpec specifies parameters that an underlying storage system uses | ||
// when creating a volumegroup replica. A specific VolumeGroupReplicationClass is used by specifying | ||
// its name in a VolumeGroupReplication object. | ||
// +kubebuilder:validation:XValidation:rule="has(self.parameters) == has(oldSelf.parameters)",message="parameters are immutable" | ||
type VolumeGroupReplicationClassSpec struct { | ||
// Provisioner is the name of storage provisioner | ||
// +kubebuilder:validation:Required | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="provisioner is immutable" | ||
Provisioner string `json:"provisioner"` | ||
// Parameters is a key-value map with storage provisioner specific configurations for | ||
// creating volume group replicas | ||
// +kubebuilder:validation:Optional | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="parameters are immutable" | ||
Parameters map[string]string `json:"parameters,omitempty"` | ||
} | ||
|
||
// VolumeGroupReplicationClassStatus defines the observed state of VolumeGroupReplicationClass | ||
type VolumeGroupReplicationClassStatus struct { | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
|
||
// VolumeGroupReplicationClass is the Schema for the volumegroupreplicationclasses API | ||
type VolumeGroupReplicationClass struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec VolumeGroupReplicationClassSpec `json:"spec,omitempty"` | ||
Status VolumeGroupReplicationClassStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// VolumeGroupReplicationClassList contains a list of VolumeGroupReplicationClass | ||
type VolumeGroupReplicationClassList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []VolumeGroupReplicationClass `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&VolumeGroupReplicationClass{}, &VolumeGroupReplicationClassList{}) | ||
} |
101 changes: 101 additions & 0 deletions
101
apis/replication.storage/v1alpha1/volumegroupreplicationcontent_types.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
/* | ||
Copyright 2024 The Kubernetes-CSI-Addons Authors. | ||
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 v1alpha1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// VolumeGroupReplicationContentSpec defines the desired state of VolumeGroupReplicationContent | ||
type VolumeGroupReplicationContentSpec struct { | ||
// VolumeGroupreplicationRef specifies the VolumeGroupReplication object to which this | ||
// 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. | ||
// +kubebuilder:validation:XValidation:rule="has(self.name) && has(self.__namespace__)",message="both volumeGroupReplicationRef.name and volumeGroupReplicationRef.namespace must be set" | ||
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="volumeGroupReplicationRef is immutable" | ||
VolumeGroupReplicationRef corev1.ObjectReference `json:"volumeGroupReplicationRef"` | ||
|
||
// VolumeGroupReplicationHandle is a unique id returned by the CSI driver | ||
// to identify the VolumeGroupReplication on the storage system. | ||
VolumeGroupReplicationHandle string `json:"volumeGroupReplicationHandle"` | ||
|
||
// provisioner is the name of the CSI driver used to create the physical | ||
// volume group on | ||
// the underlying storage system. | ||
// This MUST be the same as the name returned by the CSI GetPluginName() call for | ||
// that driver. | ||
// Required. | ||
Provisioner string `json:"provisioner"` | ||
|
||
// VolumeGroupReplicationClassName is the name of the VolumeGroupReplicationClass from | ||
// which this group replication was (or will be) created. | ||
// +optional | ||
VolumeGroupReplicationClassName string `json:"volumeGroupReplicationClassName"` | ||
|
||
// Source specifies whether the snapshot is (or should be) dynamically provisioned | ||
// or already exists, and just requires a Kubernetes object representation. | ||
// This field is immutable after creation. | ||
// Required. | ||
Source VolumeGroupReplicationContentSource `json:"source"` | ||
} | ||
|
||
// VolumeGroupReplicationContentSource represents the CSI source of a group replication. | ||
type VolumeGroupReplicationContentSource struct { | ||
// VolumeHandles is a list of volume handles on the backend to be grouped | ||
// and replicated. | ||
VolumeHandles []string `json:"volumeHandles"` | ||
} | ||
|
||
// VolumeGroupReplicationContentStatus defines the status of VolumeGroupReplicationContent | ||
type VolumeGroupReplicationContentStatus struct { | ||
// PersistentVolumeRefList is the list of of PV for the group replication | ||
// The maximum number of allowed PV in the group is 100. | ||
// +optional | ||
PersistentVolumeRefList []corev1.LocalObjectReference `json:"persistentVolumeRefList,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
//+kubebuilder:resource:scope=Cluster | ||
|
||
// VolumeGroupReplicationContent is the Schema for the volumegroupreplicationcontents API | ||
type VolumeGroupReplicationContent struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec VolumeGroupReplicationContentSpec `json:"spec,omitempty"` | ||
Status VolumeGroupReplicationContentStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// VolumeGroupReplicationContentList contains a list of VolumeGroupReplicationContent | ||
type VolumeGroupReplicationContentList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []VolumeGroupReplicationContent `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&VolumeGroupReplicationContent{}, &VolumeGroupReplicationContentList{}) | ||
} |
Oops, something went wrong.