4.1.1
This commit is contained in:
@@ -335,7 +335,7 @@ func flattenResourceK8s(d *schema.ResourceData, k8s k8s.RecordK8S, masters []com
|
||||
func flattenWg(d *schema.ResourceData, wg k8s.ItemK8SGroup, computes []compute.RecordCompute) {
|
||||
labels := make([]string, 0)
|
||||
for _, label := range wg.Labels {
|
||||
if strings.HasPrefix(label, "workerGroupName") {
|
||||
if strings.HasPrefix(label, "workersGroupName") {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,6 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute) er
|
||||
log.Debugf("flattenCompute: ID %d, RG ID %d", computeRec.ID, computeRec.RGID)
|
||||
|
||||
devices, _ := json.Marshal(computeRec.Devices)
|
||||
userdata, _ := json.Marshal(computeRec.Userdata)
|
||||
bootDisk := findBootDisk(computeRec.Disks)
|
||||
|
||||
//check extraDisks, ipa_type, is,
|
||||
@@ -307,16 +306,13 @@ func flattenCompute(d *schema.ResourceData, computeRec compute.RecordCompute) er
|
||||
d.Set("affinity_weight", computeRec.AffinityWeight)
|
||||
d.Set("arch", computeRec.Architecture)
|
||||
d.Set("boot_order", computeRec.BootOrder)
|
||||
d.Set("boot_disk_size", computeRec.BootDiskSize)
|
||||
d.Set("boot_disk_size", bootDisk.SizeMax)
|
||||
d.Set("boot_disk", flattenBootDisk(bootDisk))
|
||||
d.Set("boot_disk_id", bootDisk.ID)
|
||||
d.Set("sep_id", bootDisk.SepID)
|
||||
d.Set("pool", bootDisk.Pool)
|
||||
d.Set("clone_reference", computeRec.CloneReference)
|
||||
d.Set("clones", computeRec.Clones)
|
||||
if string(userdata) != "{}" {
|
||||
d.Set("cloud_init", string(userdata))
|
||||
}
|
||||
d.Set("computeci_id", computeRec.ComputeCIID)
|
||||
d.Set("created_by", computeRec.CreatedBy)
|
||||
d.Set("created_time", computeRec.CreatedTime)
|
||||
|
||||
@@ -35,6 +35,7 @@ package kvmvm
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute"
|
||||
@@ -142,8 +143,8 @@ func resourceComputeCreate(ctx context.Context, d *schema.ResourceData, m interf
|
||||
if ok {
|
||||
userdata := argVal.(string)
|
||||
if userdata != "" && userdata != "applied" {
|
||||
createReqPPC.Userdata = userdata
|
||||
createReqX86.Userdata = userdata
|
||||
createReqPPC.Userdata = strings.TrimSpace(userdata)
|
||||
createReqX86.Userdata = strings.TrimSpace(userdata)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -592,7 +593,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
}
|
||||
log.Debugf("resourceComputeUpdate: enable=%t Compute ID %s after completing its resource configuration", d.Id(), enabled)
|
||||
log.Debugf("resourceComputeUpdate: enable=%s Compute ID %v after completing its resource configuration", d.Id(), enabled)
|
||||
}
|
||||
|
||||
// check compute statuses
|
||||
@@ -702,9 +703,12 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
|
||||
|
||||
if d.HasChange("description") || d.HasChange("name") {
|
||||
req := compute.UpdateRequest{
|
||||
ComputeID: computeRec.ID,
|
||||
Name: d.Get("name").(string),
|
||||
Description: d.Get("desc").(string),
|
||||
ComputeID: computeRec.ID,
|
||||
Name: d.Get("name").(string),
|
||||
}
|
||||
|
||||
if desc, ok := d.GetOk("desc"); ok {
|
||||
req.Description = desc.(string)
|
||||
}
|
||||
|
||||
if _, err := c.CloudAPI().Compute().Update(ctx, req); err != nil {
|
||||
@@ -1531,7 +1535,6 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
ForceNew: true,
|
||||
Description: "Name of this compute. Compute names are case sensitive and must be unique in the resource group.",
|
||||
},
|
||||
|
||||
@@ -1832,7 +1835,7 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
|
||||
"started": {
|
||||
Type: schema.TypeBool,
|
||||
Optional: true,
|
||||
Computed: true,
|
||||
Default: true,
|
||||
Description: "Is compute started.",
|
||||
},
|
||||
"detach_disks": {
|
||||
|
||||
Reference in New Issue
Block a user