Skip to content

Commit

Permalink
refactoring for lsc-controller
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 May 1, 2024
1 parent d310021 commit 6f6264d
Show file tree
Hide file tree
Showing 5 changed files with 178 additions and 257 deletions.
31 changes: 1 addition & 30 deletions crds/localstorageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,13 @@ spec:
properties:
spec:
type: object
x-kubernetes-validations:
- rule: "!has(self.fileSystem)"
message: "The 'fileSystem' field is not supported yet and cannot be used."
- rule: has(self.lvm) == has(oldSelf.lvm) && has(self.fileSystem) == has(oldSelf.fileSystem)
message: "Modification error: Once defined, 'lvm' or 'fileSystem' configuration cannot be replaced or removed. Ensure the existing storage configuration type is maintained."
description: |
Defines a Kubernetes Storage class configuration.
required:
- reclaimPolicy
- volumeBindingMode
oneOf:
- required:
- lvm
- required:
- fileSystem
- lvm
properties:
isDefault:
type: boolean
default: false
description: |
Should this Storage class be used as default.
> Note that the default value is false.
reclaimPolicy:
type: string
x-kubernetes-validations:
Expand Down Expand Up @@ -120,16 +104,6 @@ spec:
The name of the thin pool.
minLength: 1
pattern: ^.*$
fileSystem:
type: object
x-kubernetes-validations:
- rule: self == oldSelf
message: Value is immutable.
required:
- localPath
properties:
localPath:
type: string
status:
type: object
description: |
Expand All @@ -152,9 +126,6 @@ spec:
- jsonPath: .status.phase
name: Phase
type: string
- jsonPath: .spec.isDefault
name: isDefault
type: boolean
- jsonPath: .status.reason
name: Reason
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type LocalStorageClassList struct {
}

type LocalStorageClassSpec struct {
IsDefault bool `json:"isDefault"`
ReclaimPolicy string `json:"reclaimPolicy"`
VolumeBindingMode string `json:"volumeBindingMode"`
LVM *LocalStorageClassLVM `json:"lvm,omitempty"`
Expand Down
Loading

0 comments on commit 6f6264d

Please sign in to comment.