From 0720d7f6bec489212f259583e1424fc6da0e6799 Mon Sep 17 00:00:00 2001 From: dayterr Date: Tue, 10 Mar 2026 16:12:34 +0300 Subject: [PATCH] 4.9.9 --- CHANGELOG.md | 2 +- docs/index.md | 2 +- .../service/cloudbroker/kvmvm/flattens.go | 19 ++++++++++++------- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc2d36f1..89b4f4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,4 +5,4 @@ #### kvmvmm | Идентификатор
задачи | Описание | | --- | --- | -| BATF-1241 | Ошибки применения новой конфигурации после импортирования в resource `decort_kvmvm` в cloudapi/kvmvm | \ No newline at end of file +| BATF-1241 | Ошибки применения новой конфигурации после импортирования в resource `decort_kvmvm` в cloudapi/kvmvm и в resource `decort_cb_kvmvm` в cloudbroker/kvmvm | \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index d324b72b..4865f24e 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,7 +18,6 @@ description: |- ### Required - `authenticator` (String) Authentication mode to use when connecting to DECORT cloud API. Should be one of 'decs3o', 'legacy', 'jwt' or 'bvs'. -- `controller_url` (String) URL of DECORT Cloud controller to use. API calls will be directed to this URL. ### Optional @@ -27,6 +26,7 @@ description: |- - `app_secret` (String) Application secret to access DECORT cloud API in 'decs3o' and 'bvs' authentication mode. - `bvs_password` (String) User password for DECORT cloud API operations in 'bvs' authentication mode. - `bvs_user` (String) User name for DECORT cloud API operations in 'bvs' authentication mode. +- `controller_url` (String) URL of DECORT Cloud controller to use. API calls will be directed to this URL. - `domain` (String) User password for DECORT cloud API operations in 'bvs' authentication mode. - `jwt` (String) JWT to access DECORT cloud API in 'jwt' authentication mode. - `oauth2_url` (String) OAuth2 application URL in 'decs3o' and 'bvs' authentication mode. diff --git a/internal/service/cloudbroker/kvmvm/flattens.go b/internal/service/cloudbroker/kvmvm/flattens.go index 46728f7b..7cdee309 100644 --- a/internal/service/cloudbroker/kvmvm/flattens.go +++ b/internal/service/cloudbroker/kvmvm/flattens.go @@ -106,6 +106,9 @@ func flattenCompute(d *schema.ResourceData, computeRec *compute.RecordCompute, p d.Set("numa_affinity", computeRec.NumaAffinity) d.Set("cpu_pin", computeRec.CPUPin) d.Set("hp_backed", computeRec.HPBacked) + + d.Set("started", computeRec.TechStatus == "STARTED") + return nil } @@ -224,10 +227,6 @@ func flattenQOS(qos compute.QOS) []map[string]interface{} { func flattenComputeDisks(disksList compute.ListDisks, 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 }) @@ -239,8 +238,14 @@ func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks [] continue } - pernamentlyValue := disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool) - nodeIds := disksBlocks[indexDataDisks].(map[string]interface{})["node_ids"].(*schema.Set) + permanentlyValue := false + var nodeIds *schema.Set + + if indexDataDisks < len(disksBlocks) { + log.Debug("entering indexDataDisks < len(disksBlocks)", indexDataDisks < len(disksBlocks), indexDataDisks, len(disksBlocks)) + permanentlyValue = disksBlocks[indexDataDisks].(map[string]interface{})["permanently"].(bool) + nodeIds = disksBlocks[indexDataDisks].(map[string]interface{})["node_ids"].(*schema.Set) + } temp := map[string]interface{}{ "disk_name": disk.Name, @@ -255,7 +260,7 @@ func flattenComputeDisks(disksList compute.ListDisks, disksBlocks, extraDisks [] "shareable": disk.Shareable, "size_used": disk.SizeUsed, "size_max": disk.SizeMax, - "permanently": pernamentlyValue, + "permanently": permanentlyValue, "present_to": disk.PresentTo, } res = append(res, temp)