From a475cf3f75c1ad2334d070dab05907419cee2afc Mon Sep 17 00:00:00 2001 From: dayterr Date: Fri, 6 Mar 2026 16:11:37 +0300 Subject: [PATCH] 4.9.9 --- CHANGELOG.md | 4 ++-- Makefile | 2 +- internal/service/cloudapi/kvmvm/flattens.go | 12 ++++++------ internal/service/cloudapi/kvmvm/resource_compute.go | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77e3379d..fc2d36f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ -## Version 4.9.8 +## Version 4.9.9 ### Исправлено #### kvmvmm | Идентификатор
задачи | Описание | | --- | --- | -| BATF-1220 | Ошибки применения новой конфигурации после импортирования в resource `decort_kvmvm` в cloudapi/kvmvm и в `decort_cb_kvmvm` в cloudbroker/kvmvm | \ No newline at end of file +| BATF-1241 | Ошибки применения новой конфигурации после импортирования в resource `decort_kvmvm` в cloudapi/kvmvm | \ No newline at end of file diff --git a/Makefile b/Makefile index af3805bd..e4541289 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ ZIPDIR = ./zip BINARY=${NAME} WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH} MAINPATH = ./cmd/decort/ -VERSION=4.9.8 +VERSION=4.9.9 OS_ARCH=$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH) FILES = ${BINARY}_${VERSION}_darwin_amd64\ diff --git a/internal/service/cloudapi/kvmvm/flattens.go b/internal/service/cloudapi/kvmvm/flattens.go index 93031113..04942d88 100644 --- a/internal/service/cloudapi/kvmvm/flattens.go +++ b/internal/service/cloudapi/kvmvm/flattens.go @@ -276,10 +276,6 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{} func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} { res := make([]map[string]interface{}, 0, len(disksList)) - if len(disksBlocks) == 0 { - return res - } - sort.Slice(disksList, func(i, j int) bool { return disksList[i].ID < disksList[j].ID }) @@ -291,7 +287,11 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex continue } - pernamentlyValue := disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool) + permanentlyValue := false + + if indexDataDisks < len(disksBlocks) { + permanentlyValue = disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool) + } temp := map[string]interface{}{ "disk_name": disk.Name, @@ -305,7 +305,7 @@ func flattenComputeDisksDemo(disksList compute.ListComputeDisks, disksBlocks, ex "desc": disk.Description, "image_id": disk.ImageID, "size": disk.SizeMax, - "permanently": pernamentlyValue, + "permanently": permanentlyValue, "present_to": disk.PresentTo, } res = append(res, temp) diff --git a/internal/service/cloudapi/kvmvm/resource_compute.go b/internal/service/cloudapi/kvmvm/resource_compute.go index c9973732..2e827716 100644 --- a/internal/service/cloudapi/kvmvm/resource_compute.go +++ b/internal/service/cloudapi/kvmvm/resource_compute.go @@ -1815,6 +1815,7 @@ func disksSubresourceSchemaMake() map[string]*schema.Schema { "permanently": { Type: schema.TypeBool, Optional: true, + Default: false, Description: "Disk deletion status", }, "disk_id": {