capability for non CSI storage
This commit is contained in:
@@ -28,6 +28,35 @@ const (
|
||||
ExpandModeOnline ExpandMode = "ONLINE"
|
||||
)
|
||||
|
||||
// VolumeFeature describe volume features
|
||||
type VolumeFeature struct {
|
||||
Create bool `json:"create"`
|
||||
Attach bool `json:"attach"`
|
||||
List bool `json:"list"`
|
||||
Clone bool `json:"clone"`
|
||||
Stats bool `json:"stats"`
|
||||
Expand ExpandMode `json:"expandMode"`
|
||||
}
|
||||
|
||||
// SnapshotFeature describe snapshot features
|
||||
type SnapshotFeature struct {
|
||||
Create bool `json:"create"`
|
||||
List bool `json:"list"`
|
||||
}
|
||||
|
||||
// CapabilityFeatures describe storage features
|
||||
type CapabilityFeatures struct {
|
||||
Topology bool `json:"topology"`
|
||||
Volume VolumeFeature `json:"volume"`
|
||||
Snapshot SnapshotFeature `json:"snapshot"`
|
||||
}
|
||||
|
||||
// PluginInfo describes plugin info
|
||||
type PluginInfo struct {
|
||||
Name string `json:"name"`
|
||||
Version string `json:"version"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +genclient:noStatus
|
||||
@@ -44,31 +73,8 @@ type StorageClassCapability struct {
|
||||
|
||||
// StorageClassCapabilitySpec defines the desired state of StorageClassCapability
|
||||
type StorageClassCapabilitySpec struct {
|
||||
Provisioner string `json:"provisioner"`
|
||||
Features StorageClassCapabilitySpecFeatures `json:"features"`
|
||||
}
|
||||
|
||||
// StorageClassCapabilitySpecFeatures describe storage class features
|
||||
type StorageClassCapabilitySpecFeatures struct {
|
||||
Topology bool `json:"topology"`
|
||||
Volume StorageClassCapabilitySpecFeaturesVolume `json:"volume"`
|
||||
Snapshot StorageClassCapabilitySpecFeaturesSnapshot `json:"snapshot"`
|
||||
}
|
||||
|
||||
// StorageClassCapabilitySpecFeaturesVolume describe volume features
|
||||
type StorageClassCapabilitySpecFeaturesVolume struct {
|
||||
Create bool `json:"create"`
|
||||
Attach bool `json:"attach"`
|
||||
List bool `json:"list"`
|
||||
Clone bool `json:"clone"`
|
||||
Stats bool `json:"stats"`
|
||||
Expand ExpandMode `json:"expandMode"`
|
||||
}
|
||||
|
||||
// StorageClassCapabilitySpecFeaturesSnapshot describe snapshot features
|
||||
type StorageClassCapabilitySpecFeaturesSnapshot struct {
|
||||
Create bool `json:"create"`
|
||||
List bool `json:"list"`
|
||||
Provisioner string `json:"provisioner"`
|
||||
Features CapabilityFeatures `json:"features"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
@@ -81,8 +87,37 @@ type StorageClassCapabilityList struct {
|
||||
Items []StorageClassCapability `json:"items"`
|
||||
}
|
||||
|
||||
// +genclient
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
// +genclient:noStatus
|
||||
// +genclient:nonNamespaced
|
||||
|
||||
// ProvisionerCapability is the schema for the provisionercapability API
|
||||
// +k8s:openapi-gen=true
|
||||
type ProvisionerCapability struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
Spec ProvisionerCapabilitySpec `json:"spec"`
|
||||
}
|
||||
|
||||
// ProvisionerCapabilitySpec defines the desired state of ProvisionerCapability
|
||||
type ProvisionerCapabilitySpec struct {
|
||||
PluginInfo PluginInfo `json:"pluginInfo"`
|
||||
Features CapabilityFeatures `json:"features"`
|
||||
}
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
type ProvisionerCapabilityList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
metav1.ListMeta `json:"metadata"`
|
||||
Items []ProvisionerCapability `json:"items"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(
|
||||
&StorageClassCapability{},
|
||||
&StorageClassCapabilityList{})
|
||||
&StorageClassCapabilityList{},
|
||||
&ProvisionerCapability{},
|
||||
&ProvisionerCapabilityList{})
|
||||
}
|
||||
|
||||
116
pkg/apis/storage/v1alpha1/zz_generated.deepcopy.go
generated
116
pkg/apis/storage/v1alpha1/zz_generated.deepcopy.go
generated
@@ -20,11 +20,43 @@ limitations under the License.
|
||||
|
||||
package v1alpha1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/apimachinery/pkg/runtime"
|
||||
)
|
||||
import "k8s.io/apimachinery/pkg/runtime"
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *PluginInfo) DeepCopyInto(out *PluginInfo) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new ProvisionerCapabilitySpecPluginInfo.
|
||||
func (in *PluginInfo) DeepCopy() *PluginInfo {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(PluginInfo)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *CapabilityFeatures) DeepCopyInto(out *CapabilityFeatures) {
|
||||
*out = *in
|
||||
out.Volume = in.Volume
|
||||
out.Snapshot = in.Snapshot
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new CapabilityFeatures.
|
||||
func (in *CapabilityFeatures) DeepCopy() *CapabilityFeatures {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(CapabilityFeatures)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassCapability) DeepCopyInto(out *StorageClassCapability) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
@@ -33,7 +65,7 @@ func (in *StorageClassCapability) DeepCopyInto(out *StorageClassCapability) {
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapability.
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new StorageClassCapability.
|
||||
func (in *StorageClassCapability) DeepCopy() *StorageClassCapability {
|
||||
if in == nil {
|
||||
return nil
|
||||
@@ -43,7 +75,7 @@ func (in *StorageClassCapability) DeepCopy() *StorageClassCapability {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
// DeepCopyObject is an autogenerated deep copy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *StorageClassCapability) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
@@ -51,7 +83,7 @@ func (in *StorageClassCapability) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassCapabilityList) DeepCopyInto(out *StorageClassCapabilityList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
@@ -66,7 +98,7 @@ func (in *StorageClassCapabilityList) DeepCopyInto(out *StorageClassCapabilityLi
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapabilityList.
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new StorageClassCapabilityList.
|
||||
func (in *StorageClassCapabilityList) DeepCopy() *StorageClassCapabilityList {
|
||||
if in == nil {
|
||||
return nil
|
||||
@@ -76,7 +108,7 @@ func (in *StorageClassCapabilityList) DeepCopy() *StorageClassCapabilityList {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
||||
// DeepCopyObject is an autogenerated deep copy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *StorageClassCapabilityList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
@@ -84,14 +116,14 @@ func (in *StorageClassCapabilityList) DeepCopyObject() runtime.Object {
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassCapabilitySpec) DeepCopyInto(out *StorageClassCapabilitySpec) {
|
||||
*out = *in
|
||||
out.Features = in.Features
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapabilitySpec.
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new StorageClassCapabilitySpec.
|
||||
func (in *StorageClassCapabilitySpec) DeepCopy() *StorageClassCapabilitySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
@@ -101,52 +133,80 @@ func (in *StorageClassCapabilitySpec) DeepCopy() *StorageClassCapabilitySpec {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassCapabilitySpecFeatures) DeepCopyInto(out *StorageClassCapabilitySpecFeatures) {
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProvisionerCapability) DeepCopyInto(out *ProvisionerCapability) {
|
||||
*out = *in
|
||||
out.Volume = in.Volume
|
||||
out.Snapshot = in.Snapshot
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||
out.Spec = in.Spec
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassCapabilitySpecFeatures.
|
||||
func (in *StorageClassCapabilitySpecFeatures) DeepCopy() *StorageClassCapabilitySpecFeatures {
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new ProvisionerCapability.
|
||||
func (in *ProvisionerCapability) DeepCopy() *ProvisionerCapability {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageClassCapabilitySpecFeatures)
|
||||
out := new(ProvisionerCapability)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassCapabilitySpecFeaturesSnapshot) DeepCopyInto(out *StorageClassCapabilitySpecFeaturesSnapshot) {
|
||||
// DeepCopyObject is an autogenerated deep copy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProvisionerCapability) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProvisionerCapabilityList) DeepCopyInto(out *ProvisionerCapabilityList) {
|
||||
*out = *in
|
||||
out.TypeMeta = in.TypeMeta
|
||||
in.ListMeta.DeepCopyInto(&out.ListMeta)
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]ProvisionerCapability, len(*in))
|
||||
for i := range *in {
|
||||
(*in)[i].DeepCopyInto(&(*out)[i])
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisionerCapabilitySpecFeaturesSnapshot.
|
||||
func (in *StorageClassCapabilitySpecFeaturesSnapshot) DeepCopy() *StorageClassCapabilitySpecFeaturesSnapshot {
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new ProvisionerCapabilityList.
|
||||
func (in *ProvisionerCapabilityList) DeepCopy() *ProvisionerCapabilityList {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageClassCapabilitySpecFeaturesSnapshot)
|
||||
out := new(ProvisionerCapabilityList)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *StorageClassCapabilitySpecFeaturesVolume) DeepCopyInto(out *StorageClassCapabilitySpecFeaturesVolume) {
|
||||
// DeepCopyObject is an autogenerated deep copy function, copying the receiver, creating a new runtime.Object.
|
||||
func (in *ProvisionerCapabilityList) DeepCopyObject() runtime.Object {
|
||||
if c := in.DeepCopy(); c != nil {
|
||||
return c
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deep copy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ProvisionerCapabilitySpec) DeepCopyInto(out *ProvisionerCapabilitySpec) {
|
||||
*out = *in
|
||||
out.PluginInfo = in.PluginInfo
|
||||
out.Features = in.Features
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProvisionerCapabilitySpecFeaturesVolume.
|
||||
func (in *StorageClassCapabilitySpecFeaturesVolume) DeepCopy() *StorageClassCapabilitySpecFeaturesVolume {
|
||||
// DeepCopy is an autogenerated deep copy function, copying the receiver, creating a new ProvisionerCapabilitySpec.
|
||||
func (in *ProvisionerCapabilitySpec) DeepCopy() *ProvisionerCapabilitySpec {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(StorageClassCapabilitySpecFeaturesVolume)
|
||||
out := new(ProvisionerCapabilitySpec)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user