Compare commits

..

2 Commits
4.3.2 ... 4.3.4

Author SHA1 Message Date
Nikita Sorokin
712f8edf9e 4.3.4 2023-08-23 16:32:48 +03:00
Nikita Sorokin
805ffe1f29 4.3.3 2023-08-22 13:15:17 +03:00
5 changed files with 21 additions and 15 deletions

View File

@@ -1,5 +1,4 @@
## Version 4.3.2
## Version 4.3.4
## Bugfixes
- Fixed bootdisk flattens
- Updated golang-decort-sdk version with fixed permamently field in cloudapi/cloudbroker/compute/diskDel
- Fixed bug with resource decort_cb_extnet: extnet did not switct status to "ENABLED" if field enable=true while resource create.

View File

@@ -7,11 +7,8 @@ ZIPDIR = ./zip
BINARY=${NAME}
WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH}
MAINPATH = ./cmd/decort/
VERSION=4.3.2
VERSION=4.3.4
OS_ARCH=$(shell go env GOHOSTOS)_$(shell go env GOHOSTARCH)
# OS_ARCH=darwin_arm64
# OS_ARCH=windows_amd64
# OS_ARCH=linux_amd64
FILES = ${BINARY}_${VERSION}_darwin_amd64\
${BINARY}_${VERSION}_darwin_arm64\

View File

@@ -36,7 +36,6 @@ import (
"encoding/json"
"sort"
"strconv"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
log "github.com/sirupsen/logrus"
@@ -237,10 +236,10 @@ func flattenBootDisk(bootDisk *compute.ItemComputeDisk) []map[string]interface{}
return res
}
func flattenComputeDisksDemo(disksList compute.ListComputeDisks, extraDisks []interface{}) []map[string]interface{} {
func flattenComputeDisksDemo(disksList compute.ListComputeDisks, extraDisks []interface{}, bootDiskId uint64) []map[string]interface{} {
res := make([]map[string]interface{}, 0, len(disksList))
for _, disk := range disksList {
if strings.Contains(disk.Name, "bootdisk") || findInExtraDisks(uint(disk.ID), extraDisks) { //skip main bootdisk and extraDisks
if disk.ID == bootDiskId || findInExtraDisks(uint(disk.ID), extraDisks) { //skip main bootdisk and extraDisks
continue
}
temp := map[string]interface{}{
@@ -281,7 +280,7 @@ func flattenNetwork(interfaces compute.ListInterfaces) []map[string]interface{}
func findBootDisk(disks compute.ListComputeDisks) *compute.ItemComputeDisk {
for _, disk := range disks {
if strings.Contains(disk.Name, "bootdisk") {
if disk.Type == "B" {
return &disk
}
}
@@ -321,7 +320,7 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute) er
d.Set("deleted_time", computeRec.DeletedTime)
d.Set("description", computeRec.Description)
d.Set("devices", string(devices))
err := d.Set("disks", flattenComputeDisksDemo(computeRec.Disks, d.Get("extra_disks").(*schema.Set).List()))
err := d.Set("disks", flattenComputeDisksDemo(computeRec.Disks, d.Get("extra_disks").(*schema.Set).List(), bootDisk.ID))
if err != nil {
return err
}

View File

@@ -772,7 +772,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
for _, disk := range deletedDisks {
diskConv := disk.(map[string]interface{})
if strings.Contains(diskConv["disk_name"].(string), "bootdisk") {
if diskConv["disk_type"].(string) == "B" {
continue
}
@@ -800,7 +800,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if len(addedDisks) > 0 {
for _, disk := range addedDisks {
diskConv := disk.(map[string]interface{})
if strings.Contains(diskConv["disk_name"].(string), "bootdisk") {
if diskConv["disk_type"].(string) == "B" {
continue
}
req := compute.DiskAddRequest{
@@ -832,7 +832,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if len(updatedDisks) > 0 {
for _, disk := range updatedDisks {
diskConv := disk.(map[string]interface{})
if strings.Contains(diskConv["disk_name"].(string), "bootdisk") {
if diskConv["disk_type"].(string) == "B" {
continue
}
req := compute.DiskResizeRequest{

View File

@@ -142,6 +142,17 @@ func resourceExtnetCreate(ctx context.Context, d *schema.ResourceData, m interfa
}
}
if d.Get("enable").(bool) {
log.Debugf("resourceExtnetCreate: trying to enable extnet with ID %d", netID)
_, err := c.CloudBroker().ExtNet().Enable(ctx, extnet.EnableRequest{
NetID: netID,
})
if err != nil {
return diag.FromErr(err)
}
}
return resourceExtnetRead(ctx, d, m)
}