-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: matancarmeli7 <[email protected]>
- Loading branch information
1 parent
bed9c6e
commit b808dde
Showing
80 changed files
with
15,455 additions
and
97 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
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,44 @@ | ||
/* | ||
Copyright 2023 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 v1 | ||
|
||
import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
|
||
// VolumeGroupDeletionPolicy describes a policy for end-of-life maintenance of | ||
// volume group contents | ||
type VolumeGroupDeletionPolicy string | ||
|
||
const ( | ||
// VolumeGroupContentDelete means the group will be deleted from the | ||
// underlying storage system on release from its volume group. | ||
VolumeGroupContentDelete VolumeGroupDeletionPolicy = "Delete" | ||
|
||
// VolumeGroupContentRetain means the group will be left in its current | ||
// state on release from its volume group. | ||
VolumeGroupContentRetain VolumeGroupDeletionPolicy = "Retain" | ||
) | ||
|
||
// Describes an error encountered on the group | ||
type VolumeGroupError struct { | ||
// time is the timestamp when the error was encountered. | ||
// +optional | ||
Time *metav1.Time `json:"time,omitempty"` | ||
|
||
// message details the encountered error | ||
// +optional | ||
Message *string `json:"message,omitempty"` | ||
} |
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,36 @@ | ||
/* | ||
Copyright 2023 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 v1 contains API Schema definitions for the csi v1 API group | ||
// +kubebuilder:object:generate=true | ||
// +groupName=volumegroup.storage.openshift.io | ||
package v1 | ||
|
||
import ( | ||
"k8s.io/apimachinery/pkg/runtime/schema" | ||
"sigs.k8s.io/controller-runtime/pkg/scheme" | ||
) | ||
|
||
var ( | ||
// GroupVersion is group version used to register these objects | ||
GroupVersion = schema.GroupVersion{Group: "volumegroup.storage.openshift.io", Version: "v1"} | ||
|
||
// SchemeBuilder is used to add go types to the GroupVersionKind scheme | ||
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} | ||
|
||
// AddToScheme adds the types in this group-version to the given scheme. | ||
AddToScheme = SchemeBuilder.AddToScheme | ||
) |
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 2023 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 v1 | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// VolumeGroupSpec describes the common attributes of group storage devices | ||
// and allows a Source for provider-specific attributes | ||
type VolumeGroupSpec struct { | ||
// +optional | ||
VolumeGroupClassName *string `json:"volumeGroupClassName,omitempty"` | ||
|
||
// Source has the information about where the group is created from. | ||
Source VolumeGroupSource `json:"source"` | ||
} | ||
|
||
// VolumeGroupSource contains several options. | ||
// OneOf the options must be defined. | ||
type VolumeGroupSource struct { | ||
// +optional | ||
// Pre-provisioned VolumeGroup | ||
VolumeGroupContentName *string `json:"volumeGroupContentName,omitempty"` | ||
|
||
// +optional | ||
// Dynamically provisioned VolumeGroup | ||
// A label query over persistent volume claims to be added to the volume group. | ||
// This labelSelector will be used to match the label added to a PVC. | ||
// In Phase 1, when the label is added to PVC, the PVC will be added to the matching group. | ||
// In Phase 2, this labelSelector will be used to find all PVCs with matching label and add them to the group when the group is being created. | ||
Selector *metav1.LabelSelector `json:"selector,omitempty"` | ||
} | ||
|
||
// VolumeGroupStatus defines the observed state of VolumeGroup | ||
type VolumeGroupStatus struct { | ||
// +optional | ||
BoundVolumeGroupContentName *string `json:"boundVolumeGroupContentName,omitempty"` | ||
|
||
// +optional | ||
GroupCreationTime *metav1.Time `json:"groupCreationTime,omitempty"` | ||
|
||
// A list of persistent volume claims | ||
// +optional | ||
PVCList []corev1.PersistentVolumeClaim `json:"pvcList,omitempty"` | ||
|
||
// +optional | ||
Ready *bool `json:"ready,omitempty"` | ||
|
||
// Last error encountered during group creation | ||
// +optional | ||
Error *VolumeGroupError `json:"error,omitempty"` | ||
} | ||
|
||
// VolumeGroup is a user's request for a group of volumes | ||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
// +kubebuilder:resource:scope=Namespaced,shortName=vg | ||
// +kubebuilder:printcolumn:name="Ready",type=boolean,JSONPath=`.status.ready` | ||
// +kubebuilder:printcolumn:name="VolumeGroupClass",type=string,JSONPath=`.spec.volumeGroupClassName` | ||
// +kubebuilder:printcolumn:name="VolumeGroupContent",type=string,JSONPath=`.status.boundVolumeGroupContentName` | ||
// +kubebuilder:printcolumn:name="CreationTime",type=date,JSONPath=`.status.groupCreationTime` | ||
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` | ||
type VolumeGroup struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec defines the volume group requested by a user | ||
Spec VolumeGroupSpec `json:"spec,omitempty"` | ||
// Status represents the current information about a volume group | ||
// +optional | ||
Status VolumeGroupStatus `json:"status,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// VolumeGroupList contains a list of VolumeGroup | ||
type VolumeGroupList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []VolumeGroup `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&VolumeGroup{}, &VolumeGroupList{}) | ||
} |
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,66 @@ | ||
/* | ||
Copyright 2023 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 v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
//+kubebuilder:object:root=true | ||
//+kubebuilder:subresource:status | ||
|
||
// VolumeGroupClass is the Schema for the volumegroupclasses API | ||
// +kubebuilder:resource:scope=Cluster,shortName=vgclass | ||
// +kubebuilder:printcolumn:name="Driver",type=string,JSONPath=`.driver` | ||
// +kubebuilder:printcolumn:name="DeletionPolicy",type=string,JSONPath=`.volumeGroupDeletionPolicy` | ||
// +kubebuilder:printcolumn:name="SupportVolumeGroupSnapshot",type=boolean,JSONPath=`.supportVolumeGroupSnapshot` | ||
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` | ||
type VolumeGroupClass struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Driver is the driver expected to handle this VolumeGroupClass. | ||
Driver string `json:"driver"` | ||
|
||
// Parameters hold parameters for the driver. | ||
// These values are opaque to the system and are passed directly | ||
// to the driver. | ||
// +optional | ||
Parameters map[string]string `json:"parameters,omitempty"` | ||
|
||
// +optional | ||
// +kubebuilder:default:=Delete | ||
VolumeGroupDeletionPolicy *VolumeGroupDeletionPolicy `json:"volumeGroupDeletionPolicy,omitempty"` | ||
|
||
// This field specifies whether group snapshot is supported. | ||
// +optional | ||
// +kubebuilder:default:=false | ||
SupportVolumeGroupSnapshot *bool `json:"supportVolumeGroupSnapshot,omitempty"` | ||
} | ||
|
||
//+kubebuilder:object:root=true | ||
|
||
// VolumeGroupClassList contains a list of VolumeGroupClass | ||
type VolumeGroupClassList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
Items []VolumeGroupClass `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&VolumeGroupClass{}, &VolumeGroupClassList{}) | ||
} |
Oops, something went wrong.