Skip to content

Commit

Permalink
[controller] Fix CRDs
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr Zimin <alexandr.zimin@flant.com>
  • Loading branch information
AleksZimin committed Feb 27, 2024
1 parent 846c347 commit 93af388
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 71 deletions.
7 changes: 1 addition & 6 deletions crds/lvmstorageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
names:
plural: lvmstorageclasses
singular: lvmstorageclass
kind: LvmStorageClass
kind: LVMStorageClass
shortNames:
- lsc
preserveUnknownFields: false
Expand All @@ -35,7 +35,6 @@ spec:
- type
- reclaimPolicy
- volumeBindingMode
- allowVolumeExpansion
- lvmVolumeGroups
properties:
isDefault:
Expand Down Expand Up @@ -79,10 +78,6 @@ spec:
enum:
- Immediate
- WaitForFirstConsumer
allowVolumeExpansion:
type: boolean
description: |
Configure if Persistent Volume is going to be expandable.
lvmVolumeGroups:
type: array
x-kubernetes-validations:
Expand Down
33 changes: 16 additions & 17 deletions images/sds-lvm-controller/api/v1alpha1/lvm_storage_class.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,38 @@ package v1alpha1

import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

type LvmStorageClass struct {
type LVMStorageClass struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec LvmStorageClassSpec `json:"spec"`
Status *LvmStorageClassStatus `json:"status,omitempty"`
Spec LVMStorageClassSpec `json:"spec"`
Status *LVMStorageClassStatus `json:"status,omitempty"`
}

// LvmStorageClassList contains a list of empty block device
type LvmStorageClassList struct {
// LVMStorageClassList contains a list of empty block device
type LVMStorageClassList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []LvmStorageClass `json:"items"`
Items []LVMStorageClass `json:"items"`
}

type LvmStorageClassSpec struct {
IsDefault bool `json:"isDefault"`
Type string `json:"type"`
ReclaimPolicy string `json:"reclaimPolicy"`
VolumeBindingMode string `json:"volumeBindingMode"`
AllowVolumeExpansion bool `json:"allowVolumeExpansion"`
LVMVolumeGroups []LvmStorageClassLVG `json:"lvmVolumeGroups"`
type LVMStorageClassSpec struct {
IsDefault bool `json:"isDefault"`
Type string `json:"type"`
ReclaimPolicy string `json:"reclaimPolicy"`
VolumeBindingMode string `json:"volumeBindingMode"`
LVMVolumeGroups []LVMStorageClassLVG `json:"lvmVolumeGroups"`
}

type LvmStorageClassStatus struct {
type LVMStorageClassStatus struct {
Phase string `json:"phase,omitempty"`
Reason string `json:"reason,omitempty"`
}

type LvmStorageClassLVG struct {
type LVMStorageClassLVG struct {
Name string `json:"name"`
Thin *LvmStorageClassThinPool `json:"thin,omitempty"`
Thin *LVMStorageClassThinPool `json:"thin,omitempty"`
}

type LvmStorageClassThinPool struct {
type LVMStorageClassThinPool struct {
PoolName string `json:"poolName"`
}
6 changes: 3 additions & 3 deletions images/sds-lvm-controller/api/v1alpha1/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

const (
LvmStorageClassKind = "LvmStorageClass"
LVMStorageClassKind = "LVMStorageClass"
APIGroup = "storage.deckhouse.io"
APIVersion = "v1alpha1"
)
Expand All @@ -41,8 +41,8 @@ var (
// Adds the list of known types to Scheme.
func addKnownTypes(scheme *runtime.Scheme) error {
scheme.AddKnownTypes(SchemeGroupVersion,
&LvmStorageClass{},
&LvmStorageClassList{},
&LVMStorageClass{},
&LVMStorageClassList{},
&LvmVolumeGroup{},
&LvmVolumeGroupList{},
)
Expand Down
18 changes: 9 additions & 9 deletions images/sds-lvm-controller/api/v1alpha1/zz_generated.deepcopy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,57 +19,57 @@ package v1alpha1
import "k8s.io/apimachinery/pkg/runtime"

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LvmStorageClass) DeepCopyInto(out *LvmStorageClass) {
func (in *LVMStorageClass) DeepCopyInto(out *LVMStorageClass) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)

}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EmptyBlockDevice.
func (in *LvmStorageClass) DeepCopy() *LvmStorageClass {
func (in *LVMStorageClass) DeepCopy() *LVMStorageClass {
if in == nil {
return nil
}
out := new(LvmStorageClass)
out := new(LVMStorageClass)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *LvmStorageClass) DeepCopyObject() runtime.Object {
func (in *LVMStorageClass) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}

// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LvmStorageClassList) DeepCopyInto(out *LvmStorageClassList) {
func (in *LVMStorageClassList) DeepCopyInto(out *LVMStorageClassList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]LvmStorageClass, len(*in))
*out = make([]LVMStorageClass, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}

// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GuestbookList.
func (in *LvmStorageClassList) DeepCopy() *LvmStorageClassList {
func (in *LVMStorageClassList) DeepCopy() *LVMStorageClassList {
if in == nil {
return nil
}
out := new(LvmStorageClassList)
out := new(LVMStorageClassList)
in.DeepCopyInto(out)
return out
}

// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *LvmStorageClassList) DeepCopyObject() runtime.Object {
func (in *LVMStorageClassList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
Expand Down
Loading

0 comments on commit 93af388

Please sign in to comment.