From 2bb578d6f400223daff6e4060bbf86f25133beee Mon Sep 17 00:00:00 2001 From: Alexandr Stefurishin Date: Thu, 21 Nov 2024 10:14:12 +0300 Subject: [PATCH] crd changes Signed-off-by: Alexandr Stefurishin --- api/go.mod | 2 +- api/go.sum | 4 +- api/v1alpha1/lvm_logical_volume_snapshot.go | 15 ++++---- crds/lvmlogicalvolumesnapshot.yaml | 42 ++++++++++----------- 4 files changed, 31 insertions(+), 32 deletions(-) diff --git a/api/go.mod b/api/go.mod index 804a8ebd..a6e247d1 100644 --- a/api/go.mod +++ b/api/go.mod @@ -2,7 +2,7 @@ module github.com/deckhouse/sds-node-configurator/api go 1.22.2 -require k8s.io/apimachinery v0.31.2 +require k8s.io/apimachinery v0.31.3 require ( github.com/fxamacker/cbor/v2 v2.7.0 // indirect diff --git a/api/go.sum b/api/go.sum index 10bc40f0..1aff0b65 100644 --- a/api/go.sum +++ b/api/go.sum @@ -74,8 +74,8 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -k8s.io/apimachinery v0.31.2 h1:i4vUt2hPK56W6mlT7Ry+AO8eEsyxMD1U44NR22CLTYw= -k8s.io/apimachinery v0.31.2/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= +k8s.io/apimachinery v0.31.3 h1:6l0WhcYgasZ/wk9ktLq5vLaoXJJr5ts6lkaQzgeYPq4= +k8s.io/apimachinery v0.31.3/go.mod h1:rsPdaZJfTfLsNJSQzNHQvYoTmxhoOEofxtOsF3rtsMo= k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk= k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE= k8s.io/utils v0.0.0-20240711033017-18e509b52bc8 h1:pUdcCO1Lk/tbT5ztQWOBi5HBgbBP1J8+AsQnQCKsi8A= diff --git a/api/v1alpha1/lvm_logical_volume_snapshot.go b/api/v1alpha1/lvm_logical_volume_snapshot.go index 6e6a71cb..daff5674 100644 --- a/api/v1alpha1/lvm_logical_volume_snapshot.go +++ b/api/v1alpha1/lvm_logical_volume_snapshot.go @@ -42,16 +42,17 @@ type LVMLogicalVolumeSnapshot struct { // +k8s:deepcopy-gen=true type LVMLogicalVolumeSnapshotSpec struct { - NodeName string `json:"nodeName"` - ActualVGNameOnTheNode string `json:"actualVGNameOnTheNode"` - ActualLVNameOnTheNode string `json:"actualLVNameOnTheNode"` ActualSnapshotNameOnTheNode string `json:"actualSnapshotNameOnTheNode"` + LVMLogicalVolumeName string `json:"lvmLogicalVolumeName"` } // +k8s:deepcopy-gen=true type LVMLogicalVolumeSnapshotStatus struct { - Phase string `json:"phase"` - Reason string `json:"reason"` - Size resource.Quantity `json:"size"` - UsedSize resource.Quantity `json:"usedSize"` + NodeName string `json:"nodeName"` + ActualVGNameOnTheNode string `json:"actualVGNameOnTheNode"` + ActualLVNameOnTheNode string `json:"actualLVNameOnTheNode"` + Phase string `json:"phase"` + Reason string `json:"reason"` + Size resource.Quantity `json:"size"` + UsedSize resource.Quantity `json:"usedSize"` } diff --git a/crds/lvmlogicalvolumesnapshot.yaml b/crds/lvmlogicalvolumesnapshot.yaml index c5d754de..948cc3b7 100644 --- a/crds/lvmlogicalvolumesnapshot.yaml +++ b/crds/lvmlogicalvolumesnapshot.yaml @@ -31,38 +31,20 @@ spec: spec: type: object required: - - nodeName - - lvmVolumeGroupName - lvmLogicalVolumeName properties: - nodeName: - type: string - description: | - The name of the kubernetes node the snapshot resides in. - x-kubernetes-validations: - - rule: self == oldSelf - message: Value is immutable. - minLength: 1 - actualVGNameOnTheNode: - type: string - description: | - The name of the volume group, where the snapshot resides in. - x-kubernetes-validations: - - rule: self == oldSelf - message: Value is immutable. - minLength: 1 - actualLVNameOnTheNode: + actualSnapshotNameOnTheNode: type: string description: | - The name of the volume the snapshot is created from. + The name of the snapshot volume. x-kubernetes-validations: - rule: self == oldSelf message: Value is immutable. minLength: 1 - actualSnapshotNameOnTheNode: + lvmLogicalVolumeName: type: string description: | - The name of the snapshot volume. + The name of the snapshotted LLV resource. x-kubernetes-validations: - rule: self == oldSelf message: Value is immutable. @@ -72,6 +54,18 @@ spec: description: | Describes the resource status. properties: + nodeName: + type: string + description: | + The name of the kubernetes node the snapshot resides in. + actualVGNameOnTheNode: + type: string + description: | + The name of the volume group, where the snapshot resides in. + actualLVNameOnTheNode: + type: string + description: | + The name of the volume the snapshot is created from. phase: type: string enum: [Created, Pending, Failed] @@ -96,6 +90,10 @@ spec: name: Snapshotted LLV Name type: string description: Snapshotted LLV name + - jsonPath: .status.nodeName + name: NodeName + type: string + description: The name of the kubernetes node the snapshot resides in.. - jsonPath: .status.phase name: Phase type: string