From a3552478455cbc3933fadae155afb9fff136a2f3 Mon Sep 17 00:00:00 2001 From: KasimBaybikov Date: Mon, 26 Dec 2022 18:08:23 +0300 Subject: [PATCH] v3.3.1 --- CHANGELOG.md | 31 +++---------------- Dockerfile | 2 +- .../cloudapi/kvmvm/data_source_compute.go | 2 +- .../cloudapi/kvmvm/resource_compute.go | 10 +++--- .../service/cloudapi/vins/resource_vins.go | 11 ++----- provider.tf | 4 +-- samples/cloudapi/data_k8s_wg/main.tf | 2 +- .../cloudapi/data_vins_ext_net_list/main.tf | 1 - .../cloudapi/data_vins_list_deleted/main.tf | 2 +- 9 files changed, 18 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d60d6..16fff22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,33 +1,10 @@ -### Version 3.3.0 +### Version 3.3.1 ### Bug fixes -- Fix bug with getting k8s_wg from import -- Fix bug with getting k8s from import +- Fix bug with sample decort_k8s_wg +- Fix bug with the absence of an optional field ext_ip_addr with vins resource ### Features -- Add data_source k8s -- Add data_source k8s_list -- Add data_source k8s_list_deleted -- Add data_source k8s_wg_list -- Add data_source k8s_wg -- Add a vins_id to the k8s schema/state -- Add a ips from computes to the k8s group workers in schema/state -- Add a ips from computes to the k8s masters in schema/state -- Add a ips from computes to the k8s_wg in schema/state -- Change data_source vins, the schema/state is aligned with the platform -- Add data_source vins_audits -- Add data_source vins_ext_net_list -- Add data_source vins_ip_list -- Change data_source vins_list, the schema/state is aligned with the platform -- Add data_source vins_list_deleted -- Add data_source vins_nat_rule_list -- Add status checker for vins resource -- Add the ability to create and update ip reservations -- Add the ability to create and update nat_rule reservations -- Add enable/disable functionality for vins resource -- Add the ability to restart vnfDev -- Add the ability to redeploy vnfDev -- Add the ability to import vins -- Add warnings handling, which does not interrupt the work when the state is successfully created +- Change cloud_init in vins resource, the field shows full information about the configuration made by the user diff --git a/Dockerfile b/Dockerfile index 15a8a6b..530ff2c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM docker.io/hashicorp/terraform:latest WORKDIR /opt/decort/tf/ COPY provider.tf ./ -COPY terraform-provider-decort ./terraform.d/plugins/digitalenergy.online/decort/decort/3.3.0/linux_amd64/ +COPY terraform-provider-decort ./terraform.d/plugins/digitalenergy.online/decort/decort/3.3.1/linux_amd64/ RUN terraform init WORKDIR /tf diff --git a/internal/service/cloudapi/kvmvm/data_source_compute.go b/internal/service/cloudapi/kvmvm/data_source_compute.go index e3f944a..0381bbf 100644 --- a/internal/service/cloudapi/kvmvm/data_source_compute.go +++ b/internal/service/cloudapi/kvmvm/data_source_compute.go @@ -183,7 +183,7 @@ func flattenCompute(d *schema.ResourceData, compFacts string) error { d.Set("enabled", true) } - d.Set("cloud_init", "applied") // NOTE: for existing compute we hard-code this value as an indicator for DiffSuppress fucntion + //d.Set("cloud_init", "applied") // NOTE: for existing compute we hard-code this value as an indicator for DiffSuppress fucntion // d.Set("status", model.Status) // d.Set("tech_status", model.TechStatus) d.Set("started", false) diff --git a/internal/service/cloudapi/kvmvm/resource_compute.go b/internal/service/cloudapi/kvmvm/resource_compute.go index df3760c..10f9d1c 100644 --- a/internal/service/cloudapi/kvmvm/resource_compute.go +++ b/internal/service/cloudapi/kvmvm/resource_compute.go @@ -782,11 +782,11 @@ func ResourceComputeSchemaMake() map[string]*schema.Schema { }, "cloud_init": { - Type: schema.TypeString, - Optional: true, - Default: "applied", - DiffSuppressFunc: cloudInitDiffSupperss, - Description: "Optional cloud_init parameters. Applied when creating new compute instance only, ignored in all other cases.", + Type: schema.TypeString, + Optional: true, + Description: "Optional cloud_init parameters. Applied when creating new compute instance only, ignored in all other cases.", + //Default: "applied", + //DiffSuppressFunc: cloudInitDiffSupperss, }, "enabled": { diff --git a/internal/service/cloudapi/vins/resource_vins.go b/internal/service/cloudapi/vins/resource_vins.go index a151dcd..5879e03 100644 --- a/internal/service/cloudapi/vins/resource_vins.go +++ b/internal/service/cloudapi/vins/resource_vins.go @@ -545,14 +545,14 @@ func resourceVinsSchemaMake() map[string]*schema.Schema { Optional: true, Default: -1, } - rets["ipcidr"] = &schema.Schema{ + rets["ext_ip_addr"] = &schema.Schema{ Type: schema.TypeString, Optional: true, + Default: "", } - rets["ext_ip_addr"] = &schema.Schema{ + rets["ipcidr"] = &schema.Schema{ Type: schema.TypeString, Optional: true, - Default: "", } rets["pre_reservations_num"] = &schema.Schema{ Type: schema.TypeInt, @@ -607,11 +607,6 @@ func resourceVinsSchemaMake() map[string]*schema.Schema { Default: "", Description: "Optional user-defined text description of this ViNS.", } - rets["ext_ip_addr"] = &schema.Schema{ - Type: schema.TypeString, - Computed: true, - Description: "IP address of the external connection (valid for ViNS connected to external network, ignored otherwise).", - } rets["restore"] = &schema.Schema{ Type: schema.TypeBool, Optional: true, diff --git a/provider.tf b/provider.tf index c57af65..e762f63 100644 --- a/provider.tf +++ b/provider.tf @@ -1,8 +1,8 @@ terraform { required_providers { decort = { - source = "digitalenergy.online/decort/decort" - version = "3.3.0" + source = " digitalenergy.online/decort/decort" + version = "3.3.1" } } } diff --git a/samples/cloudapi/data_k8s_wg/main.tf b/samples/cloudapi/data_k8s_wg/main.tf index 06160b0..ea3a014 100644 --- a/samples/cloudapi/data_k8s_wg/main.tf +++ b/samples/cloudapi/data_k8s_wg/main.tf @@ -25,7 +25,7 @@ provider "decort" { allow_unverified_ssl = true } -data "decort_k8s_wf" "k8s_wg" { +data "decort_k8s_wg" "k8s_wg" { #id кластера #обязательный параметр #тип - число diff --git a/samples/cloudapi/data_vins_ext_net_list/main.tf b/samples/cloudapi/data_vins_ext_net_list/main.tf index 14c7e6a..22740b8 100644 --- a/samples/cloudapi/data_vins_ext_net_list/main.tf +++ b/samples/cloudapi/data_vins_ext_net_list/main.tf @@ -30,7 +30,6 @@ data "decort_vins_ext_net_list" "vins_ext_net_list" { #id жедаемого vins #тип - число vins_id = 10101 - } output "test" { diff --git a/samples/cloudapi/data_vins_list_deleted/main.tf b/samples/cloudapi/data_vins_list_deleted/main.tf index 2b784eb..e1d35ae 100644 --- a/samples/cloudapi/data_vins_list_deleted/main.tf +++ b/samples/cloudapi/data_vins_list_deleted/main.tf @@ -25,7 +25,7 @@ provider "decort" { allow_unverified_ssl = true } -data "decort_vins_list_deleted" "vinslist_deleted" { +data "decort_vins_list_deleted" "vins_list_deleted" { #кол-во страниц для вывода #опицональный параметр #тип - число