From 0641ea6c5ef9144426cbba845e2af4de8da0f7d7 Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Thu, 30 May 2024 13:06:51 +0800 Subject: [PATCH] CRD: add Provisioner field - Also update the deploy crd for testing Signed-off-by: Vicente Cheng --- .../crds/harvesterhci.io_blockdevices.yaml | 13 +++++++++++-- manifests/crds/harvesterhci.io_blockdevices.yaml | 8 ++++++++ pkg/apis/harvesterhci.io/v1beta1/types.go | 6 ++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/deploy/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml b/deploy/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml index b896b49d..679a906c 100644 --- a/deploy/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml +++ b/deploy/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml @@ -23,7 +23,7 @@ spec: - jsonPath: .status.deviceStatus.details.deviceType name: Type type: string - - jsonPath: .spec.devPath + - jsonPath: .status.deviceStatus.devPath name: DevPath type: string - jsonPath: .status.deviceStatus.fileSystem.mountPoint @@ -84,8 +84,13 @@ spec: nodeName: description: name of the node to which the block device is attached type: string + provisioner: + description: a string with the provisioner name, e.g. "Longhornv1, + Longhornv2 or LocalLVM" + type: string tags: - description: a string with for device tag for provisioner, e.g. "default,small,ssd" + description: a string list with device tag for provisioner, e.g. ["default", + "small", "ssd"] items: type: string type: array @@ -274,6 +279,10 @@ spec: - Unprovisioned - Unprovisioning type: string + provisioner: + description: a string with the provisioner name, e.g. "Longhornv1, + Longhornv2 or LocalLVM" + type: string state: description: the current state of the block device, options are "Active", "Inactive", or "Unknown" diff --git a/manifests/crds/harvesterhci.io_blockdevices.yaml b/manifests/crds/harvesterhci.io_blockdevices.yaml index cc09566f..679a906c 100644 --- a/manifests/crds/harvesterhci.io_blockdevices.yaml +++ b/manifests/crds/harvesterhci.io_blockdevices.yaml @@ -84,6 +84,10 @@ spec: nodeName: description: name of the node to which the block device is attached type: string + provisioner: + description: a string with the provisioner name, e.g. "Longhornv1, + Longhornv2 or LocalLVM" + type: string tags: description: a string list with device tag for provisioner, e.g. ["default", "small", "ssd"] @@ -275,6 +279,10 @@ spec: - Unprovisioned - Unprovisioning type: string + provisioner: + description: a string with the provisioner name, e.g. "Longhornv1, + Longhornv2 or LocalLVM" + type: string state: description: the current state of the block device, options are "Active", "Inactive", or "Unknown" diff --git a/pkg/apis/harvesterhci.io/v1beta1/types.go b/pkg/apis/harvesterhci.io/v1beta1/types.go index 4b2a3c48..7069cc32 100644 --- a/pkg/apis/harvesterhci.io/v1beta1/types.go +++ b/pkg/apis/harvesterhci.io/v1beta1/types.go @@ -42,6 +42,9 @@ type BlockDeviceSpec struct { // a string list with device tag for provisioner, e.g. ["default", "small", "ssd"] Tags []string `json:"tags,omitempty"` + + // a string with the provisioner name, e.g. "Longhornv1, Longhornv2 or LocalLVM" + Provisioner string `json:"provisioner,omitempty"` } type BlockDeviceStatus struct { @@ -62,6 +65,9 @@ type BlockDeviceStatus struct { // The current Tags of the blockdevice Tags []string `json:"tags,omitempty"` + + // a string with the provisioner name, e.g. "Longhornv1, Longhornv2 or LocalLVM" + Provisioner string `json:"provisioner,omitempty"` } type FilesystemInfo struct {