gos_tech_4.4.3 4.1.1
Tim Tkachev 2 years ago
parent caf7213bca
commit 371bb0d90f

@ -1,13 +1,10 @@
## Version 4.1.0 ## Version 4.1.1
## Features
- Added cloudapi/flipgroup functionality to provider:
- decort_flipgroup data source - read info about created flipgroup
- decort_flipgroup_list data source - read info about all created flipgroups
- decort_flipgroup resource - manage flipgroup instance
## Bug Fixes ## Bug Fixes
- Increased resource_vins timeouts - Resolved possible context cancelation issues when awaiting platform response
- Automated compute start/stop when managing networks - resource decort_k8s_wg:
- Removed reading of default generated label "workersGroupName=" in resource_k8s, resource_k8s_wg in tfstate - Added ignore of "workersGroupName" label
- Updated samples for flipgroups, image, pfw, k8s resources and data sources - resource decort_kvmvm:
- Fixed "boot_disk_size" incorrect state
- Fixed disappearing of "cloud_init" field value
- Set "started" default value to true

@ -8,7 +8,7 @@ ZIPDIR = ./zip
BINARY=${NAME}.exe BINARY=${NAME}.exe
WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH} WORKPATH= ./examples/terraform.d/plugins/${HOSTNAME}/${NAMESPACE}/${NAMESPACE}/${VERSION}/${OS_ARCH}
MAINPATH = ./cmd/decort/ MAINPATH = ./cmd/decort/
VERSION=4.1.0 VERSION=4.1.1
#OS_ARCH=darwin_amd64 #OS_ARCH=darwin_amd64
OS_ARCH=windows_amd64 OS_ARCH=windows_amd64
#OS_ARCH=linux_amd64 #OS_ARCH=linux_amd64

@ -9,7 +9,7 @@ require (
github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.24.1
github.com/sirupsen/logrus v1.9.0 github.com/sirupsen/logrus v1.9.0
golang.org/x/net v0.5.0 golang.org/x/net v0.5.0
repository.basistech.ru/BASIS/decort-golang-sdk v1.4.3 repository.basistech.ru/BASIS/decort-golang-sdk v1.4.4
) )
require ( require (

@ -332,5 +332,5 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
repository.basistech.ru/BASIS/decort-golang-sdk v1.4.3 h1:jrBl90lRfp34bE3m30N3mYIDTSlaPySuo+pE7bK4eOI= repository.basistech.ru/BASIS/decort-golang-sdk v1.4.4 h1:qoot6a9UPOihncfhmhmyzMd0nGVAzY/b1Gvs+AFk1/k=
repository.basistech.ru/BASIS/decort-golang-sdk v1.4.3/go.mod h1:szsTGa73O75ckCWVGJPvTtRbhA/ubuYrYhMkPjvHlmE= repository.basistech.ru/BASIS/decort-golang-sdk v1.4.4/go.mod h1:szsTGa73O75ckCWVGJPvTtRbhA/ubuYrYhMkPjvHlmE=

@ -158,7 +158,6 @@ func ControllerConfigure(d *schema.ResourceData) (*ControllerCfg, error) {
Username: ret_config.legacy_user, Username: ret_config.legacy_user,
Password: ret_config.legacy_password, Password: ret_config.legacy_password,
DecortURL: ret_config.controller_url, DecortURL: ret_config.controller_url,
Retries: 0,
SSLSkipVerify: allow_unverified_ssl, SSLSkipVerify: allow_unverified_ssl,
} }

@ -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) { func flattenWg(d *schema.ResourceData, wg k8s.ItemK8SGroup, computes []compute.RecordCompute) {
labels := make([]string, 0) labels := make([]string, 0)
for _, label := range wg.Labels { for _, label := range wg.Labels {
if strings.HasPrefix(label, "workerGroupName") { if strings.HasPrefix(label, "workersGroupName") {
continue 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) log.Debugf("flattenCompute: ID %d, RG ID %d", computeRec.ID, computeRec.RGID)
devices, _ := json.Marshal(computeRec.Devices) devices, _ := json.Marshal(computeRec.Devices)
userdata, _ := json.Marshal(computeRec.Userdata)
bootDisk := findBootDisk(computeRec.Disks) bootDisk := findBootDisk(computeRec.Disks)
//check extraDisks, ipa_type, is, //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("affinity_weight", computeRec.AffinityWeight)
d.Set("arch", computeRec.Architecture) d.Set("arch", computeRec.Architecture)
d.Set("boot_order", computeRec.BootOrder) 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", flattenBootDisk(bootDisk))
d.Set("boot_disk_id", bootDisk.ID) d.Set("boot_disk_id", bootDisk.ID)
d.Set("sep_id", bootDisk.SepID) d.Set("sep_id", bootDisk.SepID)
d.Set("pool", bootDisk.Pool) d.Set("pool", bootDisk.Pool)
d.Set("clone_reference", computeRec.CloneReference) d.Set("clone_reference", computeRec.CloneReference)
d.Set("clones", computeRec.Clones) d.Set("clones", computeRec.Clones)
if string(userdata) != "{}" {
d.Set("cloud_init", string(userdata))
}
d.Set("computeci_id", computeRec.ComputeCIID) d.Set("computeci_id", computeRec.ComputeCIID)
d.Set("created_by", computeRec.CreatedBy) d.Set("created_by", computeRec.CreatedBy)
d.Set("created_time", computeRec.CreatedTime) d.Set("created_time", computeRec.CreatedTime)

@ -35,6 +35,7 @@ package kvmvm
import ( import (
"context" "context"
"strconv" "strconv"
"strings"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/compute" "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 { if ok {
userdata := argVal.(string) userdata := argVal.(string)
if userdata != "" && userdata != "applied" { if userdata != "" && userdata != "applied" {
createReqPPC.Userdata = userdata createReqPPC.Userdata = strings.TrimSpace(userdata)
createReqX86.Userdata = userdata createReqX86.Userdata = strings.TrimSpace(userdata)
} }
} }
@ -592,7 +593,7 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
return diag.FromErr(err) 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 // check compute statuses
@ -702,9 +703,12 @@ func resourceComputeUpdate(ctx context.Context, d *schema.ResourceData, m interf
if d.HasChange("description") || d.HasChange("name") { if d.HasChange("description") || d.HasChange("name") {
req := compute.UpdateRequest{ req := compute.UpdateRequest{
ComputeID: computeRec.ID, ComputeID: computeRec.ID,
Name: d.Get("name").(string), Name: d.Get("name").(string),
Description: d.Get("desc").(string), }
if desc, ok := d.GetOk("desc"); ok {
req.Description = desc.(string)
} }
if _, err := c.CloudAPI().Compute().Update(ctx, req); err != nil { if _, err := c.CloudAPI().Compute().Update(ctx, req); err != nil {
@ -1531,7 +1535,6 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema {
"name": { "name": {
Type: schema.TypeString, Type: schema.TypeString,
Required: true, Required: true,
ForceNew: true,
Description: "Name of this compute. Compute names are case sensitive and must be unique in the resource group.", 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": { "started": {
Type: schema.TypeBool, Type: schema.TypeBool,
Optional: true, Optional: true,
Computed: true, Default: true,
Description: "Is compute started.", Description: "Is compute started.",
}, },
"detach_disks": { "detach_disks": {

Loading…
Cancel
Save