Skip to content

Commit

Permalink
CCE: Nodes extend_params volume parameter introduced (#2056)
Browse files Browse the repository at this point in the history
CCE: Nodes `extend_params` volume parameter introduced

Summary of the Pull Request
New extend_params parameter introduced for nodes/node_pools instead of extend_param.
CCE Volumes extend_param was trying to unmarshal a map of strings into a single string which lead to an error.
This change fixes this issue and unmarshals Volume structure properly.
PR Checklist

 Refers to: #2050
 Tests added/passed.
 Documentation updated.
 Schema updated.
 Release notes added.

Acceptance Steps Performed
=== RUN   TestAccCCENodePoolV3ImportBasic
=== PAUSE TestAccCCENodePoolV3ImportBasic
=== CONT  TestAccCCENodePoolV3ImportBasic
=== CONT  TestAccCCENodePoolV3ImportBasic
    resource_opentelekomcloud_cce_node_pool_v3_test.go:64: Cluster is required by the test. 3 test(s) are using cluster.
=== CONT  TestAccCCENodePoolV3ImportBasic
    cluster.go:137: Cluster usage is 0 now, ready to delete the cluster
    cluster.go:100: starting deleting shared cluster
--- PASS: TestAccCCENodePoolV3ImportBasic (827.20s)
=== RUN   TestAccCCENodePoolsV3_basic
=== PAUSE TestAccCCENodePoolsV3_basic
=== CONT  TestAccCCENodePoolsV3_basic
=== CONT  TestAccCCENodePoolsV3_basic
    resource_opentelekomcloud_cce_node_pool_v3_test.go:32: Cluster is required by the test. 1 test(s) are using cluster.
=== CONT  TestAccCCENodePoolsV3_basic
    cluster.go:49: starting creating shared cluster
2023/01/18 23:49:24 [DEBUG] Waiting for state to become: [Available]
=== CONT  TestAccCCENodePoolsV3_basic
    cluster.go:137: Cluster usage is 0 now, ready to delete the cluster
    cluster.go:100: starting deleting shared cluster
--- PASS: TestAccCCENodePoolsV3_basic (1181.55s)
PASS

Process finished with the exit code 0


=== RUN   TestAccCCENodesV3Basic
=== PAUSE TestAccCCENodesV3Basic
=== CONT  TestAccCCENodesV3Basic
    resource_opentelekomcloud_cce_node_v3_test.go:29: Cluster is required by the test. 1 test(s) are using cluster.
=== CONT  TestAccCCENodesV3Basic
    cluster.go:49: starting creating shared cluster
2023/01/19 10:51:45 [DEBUG] Waiting for state to become: [Available]
=== CONT  TestAccCCENodesV3Basic
    cluster.go:137: Cluster is released by the test. 9 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3Basic (745.93s)
=== RUN   TestAccCCENodesV3Timeout
=== PAUSE TestAccCCENodesV3Timeout
=== CONT  TestAccCCENodesV3Timeout
    resource_opentelekomcloud_cce_node_v3_test.go:83: Cluster is required by the test. 10 test(s) are using cluster.
=== CONT  TestAccCCENodesV3Timeout
    cluster.go:137: Cluster is released by the test. 7 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3Timeout (356.54s)
=== RUN   TestAccCCENodesV3BandWidthResize
=== PAUSE TestAccCCENodesV3BandWidthResize
=== CONT  TestAccCCENodesV3BandWidthResize
    resource_opentelekomcloud_cce_node_v3_test.go:133: Cluster is required by the test. 8 test(s) are using cluster.
=== CONT  TestAccCCENodesV3BandWidthResize
    cluster.go:137: Cluster is released by the test. 5 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3BandWidthResize (1083.01s)
=== RUN   TestAccCCENodesV3_eipIds
=== PAUSE TestAccCCENodesV3_eipIds
=== CONT  TestAccCCENodesV3_eipIds
    resource_opentelekomcloud_cce_node_v3_test.go:168: Cluster is required by the test. 10 test(s) are using cluster.
=== CONT  TestAccCCENodesV3_eipIds
    cluster.go:137: Cluster is released by the test. 1 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3_eipIds (1467.64s)
=== RUN   TestAccCCENodesV3IpSetNull
=== PAUSE TestAccCCENodesV3IpSetNull
=== CONT  TestAccCCENodesV3IpSetNull
    resource_opentelekomcloud_cce_node_v3_test.go:198: Cluster is required by the test. 9 test(s) are using cluster.
=== CONT  TestAccCCENodesV3IpSetNull
    cluster.go:137: Cluster usage is 0 now, ready to delete the cluster
    cluster.go:100: starting deleting shared cluster
--- PASS: TestAccCCENodesV3IpSetNull (1954.10s)
=== RUN   TestAccCCENodesV3IpCreate
=== PAUSE TestAccCCENodesV3IpCreate
=== CONT  TestAccCCENodesV3IpCreate
=== CONT  TestAccCCENodesV3IpCreate
    resource_opentelekomcloud_cce_node_v3_test.go:231: Cluster is required by the test. 2 test(s) are using cluster.
=== CONT  TestAccCCENodesV3IpCreate
    cluster.go:137: Cluster is released by the test. 2 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3IpCreate (1433.47s)
=== RUN   TestAccCCENodesV3IpWithExtendedParameters
=== PAUSE TestAccCCENodesV3IpWithExtendedParameters
=== CONT  TestAccCCENodesV3IpWithExtendedParameters
=== CONT  TestAccCCENodesV3IpWithExtendedParameters
    resource_opentelekomcloud_cce_node_v3_test.go:261: Cluster is required by the test. 5 test(s) are using cluster.
=== CONT  TestAccCCENodesV3IpWithExtendedParameters
    cluster.go:137: Cluster is released by the test. 9 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3IpWithExtendedParameters (698.45s)
=== RUN   TestAccCCENodesV3IpNulls
=== PAUSE TestAccCCENodesV3IpNulls
=== CONT  TestAccCCENodesV3IpNulls
    resource_opentelekomcloud_cce_node_v3_test.go:288: Cluster is required by the test. 6 test(s) are using cluster.
=== CONT  TestAccCCENodesV3IpNulls
    cluster.go:137: Cluster is released by the test. 4 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3IpNulls (1368.88s)
=== RUN   TestAccCCENodesV3EncryptedVolume
=== PAUSE TestAccCCENodesV3EncryptedVolume
=== CONT  TestAccCCENodesV3EncryptedVolume
    resource_opentelekomcloud_cce_node_v3_test.go:310: Cluster is required by the test. 3 test(s) are using cluster.
=== CONT  TestAccCCENodesV3EncryptedVolume
    cluster.go:137: Cluster is released by the test. 9 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3EncryptedVolume (707.57s)
=== RUN   TestAccCCENodesV3TaintsK8sTags
=== PAUSE TestAccCCENodesV3TaintsK8sTags
=== CONT  TestAccCCENodesV3TaintsK8sTags
    resource_opentelekomcloud_cce_node_v3_test.go:334: Cluster is required by the test. 7 test(s) are using cluster.
=== CONT  TestAccCCENodesV3TaintsK8sTags
    cluster.go:137: Cluster is released by the test. 8 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3TaintsK8sTags (1037.79s)
=== RUN   TestAccCCENodesV3_extendParams
=== PAUSE TestAccCCENodesV3_extendParams
=== CONT  TestAccCCENodesV3_extendParams
=== CONT  TestAccCCENodesV3_extendParams
    resource_opentelekomcloud_cce_node_v3_test.go:362: Cluster is required by the test. 4 test(s) are using cluster.
=== CONT  TestAccCCENodesV3_extendParams
    cluster.go:137: Cluster is released by the test. 9 test(s) are still using cluster.
--- PASS: TestAccCCENodesV3_extendParams (696.74s)
=== RUN   TestAccCCENodesV3Multiple
=== PAUSE TestAccCCENodesV3Multiple
=== CONT  TestAccCCENodesV3Multiple
    resource_opentelekomcloud_cce_node_v3_test.go:64: Cluster is required by the test. 1 test(s) are using cluster.
    cluster.go:49: starting creating shared cluster
2023/01/19 12:20:07 [DEBUG] Waiting for state to become: [Available]
    cluster.go:137: Cluster usage is 0 now, ready to delete the cluster
    cluster.go:100: starting deleting shared cluster
--- PASS: TestAccCCENodesV3Multiple (836.31s)
=== RUN   TestAccCCENodesV3OS
=== PAUSE TestAccCCENodesV3OS
=== CONT  TestAccCCENodesV3OS
    resource_opentelekomcloud_cce_node_v3_test.go:106: Cluster is required by the test. 1 test(s) are using cluster.
    cluster.go:49: starting creating shared cluster
2023/01/19 13:16:38 [DEBUG] Waiting for state to become: [Available]
    cluster.go:137: Cluster usage is 0 now, ready to delete the cluster
    cluster.go:100: starting deleting shared cluster
--- PASS: TestAccCCENodesV3OS (785.00s)
PASS

Process finished with the exit code 0

Reviewed-by: Aloento
Reviewed-by: Anton Sidelnikov
  • Loading branch information
artem-lifshits committed Jan 19, 2023
1 parent 357c461 commit ee8340b
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 28 deletions.
15 changes: 13 additions & 2 deletions docs/resources/cce_node_pool_v3.md
Expand Up @@ -36,6 +36,13 @@ resource "opentelekomcloud_cce_node_pool_v3" "node_pool_1" {
size = 100
volumetype = "SSD"
}
data_volumes {
size = 100
volumetype = "SSD"
extend_params = {
"useType" = "docker"
}
}
}
```

Expand Down Expand Up @@ -114,13 +121,17 @@ the AZ based on the AZ sequence. For more details see
* `root_volume` - (Required) It corresponds to the system disk related configuration. Changing this parameter will create a new resource.
* `size` - (Required) Disk size in GB.
* `volumetype` - (Required) Disk type.
* `extend_param` - (Optional) Disk expansion parameters.
* `extend_params` - (Optional) Disk expansion parameters. A list of strings which describes additional disk parameters.
* `extend_param` **DEPRECATED** - (Optional) Disk expansion parameters.
Please use alternative parameter `extend_params`.
* `kms_id` - (Optional) The Encryption KMS ID of the system volume. By default, it tries to get from env by `OS_KMS_ID`.

* `data_volumes` - (Required) Represents the data disk to be created. Changing this parameter will create a new resource.
* `size` - (Required) Disk size in GB.
* `volumetype` - (Required) Disk type.
* `extend_param` - (Optional) Disk expansion parameters.
* `extend_params` - (Optional) Disk expansion parameters. A list of strings which describes additional disk parameters.
* `extend_param` **DEPRECATED** - (Optional) Disk expansion parameters.
Please use alternative parameter `extend_params`.
* `kms_id` - (Optional) The Encryption KMS ID of the data volume. By default, it tries to get from env by `OS_KMS_ID`.

-> To enable encryption with the KMS. Firstly, you need to create the agency to grant KMS rights to EVS.
Expand Down
15 changes: 13 additions & 2 deletions docs/resources/cce_node_v3.md
Expand Up @@ -33,6 +33,13 @@ resource "opentelekomcloud_cce_node_v3" "node_1" {
size = 100
volumetype = "SATA"
}
data_volumes {
size = 100
volumetype = "SSD"
extend_params = {
"useType" = "docker"
}
}
}
```

Expand Down Expand Up @@ -134,13 +141,17 @@ The following arguments are supported:
* `root_volume` - (Required) It corresponds to the system disk related configuration. Changing this parameter will create a new resource.
* `size` - (Required) Disk size in GB.
* `volumetype` - (Required) Disk type.
* `extend_param` - (Optional) Disk expansion parameters.
* `extend_params` - (Optional) Disk expansion parameters. A list of strings which describes additional disk parameters.
* `extend_param` **DEPRECATED** - (Optional) Disk expansion parameters.
Please use alternative parameter `extend_params`.
* `kms_id` - (Optional) The Encryption KMS ID of the system volume. By default, it tries to get from env by `OS_KMS_ID`.

* `data_volumes` - (Required) Represents the data disk to be created. Changing this parameter will create a new resource.
* `size` - (Required) Disk size in GB.
* `volumetype` - (Required) Disk type.
* `extend_param` - (Optional) Disk expansion parameters.
* `extend_params` - (Optional) Disk expansion parameters. A list of strings which describes additional disk parameters.
* `extend_param` **DEPRECATED** - (Optional) Disk expansion parameters.
Please use alternative parameter `extend_params`.
* `kms_id` - (Optional) The Encryption KMS ID of the data volume. By default, it tries to get from env by `OS_KMS_ID`.

-> To enable encryption with the KMS. Firstly, you need to create the agency to grant KMS rights to EVS.
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -14,7 +14,7 @@ require (
github.com/jinzhu/copier v0.3.5
github.com/keybase/go-crypto v0.0.0-20200123153347-de78d2cb44f4
github.com/mitchellh/go-homedir v1.1.0
github.com/opentelekomcloud/gophertelekomcloud v0.5.27-0.20230110094736-54b55975ed5c
github.com/opentelekomcloud/gophertelekomcloud v0.5.28-0.20230118161751-e5094ee361b0
github.com/unknwon/com v1.0.1
golang.org/x/crypto v0.0.0-20220517005047-85d78b3ac167
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -207,8 +207,8 @@ github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce h1:RPclfga2SEJmgMmz2k
github.com/nsf/jsondiff v0.0.0-20200515183724-f29ed568f4ce/go.mod h1:uFMI8w+ref4v2r9jz+c9i1IfIttS/OkmLfrk1jne5hs=
github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/opentelekomcloud/gophertelekomcloud v0.5.27-0.20230110094736-54b55975ed5c h1:TOdxLN1shE19C1rufdBZR1mlV5nBvKxDXk+OCfXqr80=
github.com/opentelekomcloud/gophertelekomcloud v0.5.27-0.20230110094736-54b55975ed5c/go.mod h1:/QD0ZIzm3zMdE0iBSAP3+Z9eCViU2PgnQqp4KGrpR/M=
github.com/opentelekomcloud/gophertelekomcloud v0.5.28-0.20230118161751-e5094ee361b0 h1:zbeWVvggP6zeB4wH6zQFsZeYY5vEpEyPAmNcC7QFcqc=
github.com/opentelekomcloud/gophertelekomcloud v0.5.28-0.20230118161751-e5094ee361b0/go.mod h1:/QD0ZIzm3zMdE0iBSAP3+Z9eCViU2PgnQqp4KGrpR/M=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
Expand Up @@ -44,13 +44,15 @@ func TestAccCCENodePoolsV3_basic(t *testing.T) {
resource.TestCheckResourceAttr(nodePoolResourceName, "flavor", "s2.large.2"),
resource.TestCheckResourceAttr(nodePoolResourceName, "os", "EulerOS 2.5"),
resource.TestCheckResourceAttr(nodePoolResourceName, "k8s_tags.kubelet.kubernetes.io/namespace", "muh"),
resource.TestCheckResourceAttr(nodePoolResourceName, "data_volumes.0.extend_params.useType", "docker"),
),
},
{
Config: testAccCCENodePoolV3Update,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(nodePoolResourceName, "initial_node_count", "2"),
resource.TestCheckResourceAttr(nodePoolResourceName, "k8s_tags.kubelet.kubernetes.io/namespace", "kuh"),
resource.TestCheckResourceAttr(nodePoolResourceName, "data_volumes.0.extend_params.useType", "docker"),
),
},
},
Expand Down Expand Up @@ -257,6 +259,9 @@ resource "opentelekomcloud_cce_node_pool_v3" "node_pool" {
data_volumes {
size = 100
volumetype = "SSD"
extend_params = {
"useType" = "docker"
}
}
k8s_tags = {
Expand All @@ -271,7 +276,7 @@ resource "opentelekomcloud_cce_node_pool_v3" "node_pool" {
cluster_id = data.opentelekomcloud_cce_cluster_v3.cluster.id
name = "opentelekomcloud-cce-node-pool"
os = "EulerOS 2.5"
flavor = "s3.medium.1"
flavor = "s2.large.2"
initial_node_count = 2
availability_zone = "%s"
key_pair = "%s"
Expand All @@ -289,6 +294,9 @@ resource "opentelekomcloud_cce_node_pool_v3" "node_pool" {
data_volumes {
size = 100
volumetype = "SSD"
extend_params = {
"useType" = "docker"
}
}
k8s_tags = {
Expand Down
Expand Up @@ -45,12 +45,14 @@ func TestAccCCENodesV3Basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceNameNode, "flavor_id", "s2.large.2"),
resource.TestCheckResourceAttr(resourceNameNode, "os", "EulerOS 2.9"),
resource.TestCheckResourceAttr(resourceNameNode, "private_ip", privateIP),
resource.TestCheckResourceAttr(resourceNameNode, "data_volumes.0.extend_params.useType", "docker"),
),
},
{
Config: testAccCCENodeV3Update(privateIP),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceNameNode, "name", "test-node2"),
resource.TestCheckResourceAttr(resourceNameNode, "data_volumes.0.extend_params.useType", "docker"),
),
},
},
Expand Down Expand Up @@ -523,7 +525,10 @@ resource "opentelekomcloud_cce_node_v3" "node_1" {
data_volumes {
size = 100
volumetype = "SATA"
volumetype = "SSD"
extend_params = {
"useType" = "docker"
}
}
private_ip = "%s"
Expand All @@ -549,7 +554,10 @@ resource "opentelekomcloud_cce_node_v3" "node_1" {
}
data_volumes {
size = 100
volumetype = "SATA"
volumetype = "SSD"
extend_params = {
"useType" = "docker"
}
}
private_ip = "%s"
Expand Down
Expand Up @@ -111,9 +111,16 @@ func ResourceCCENodePoolV3() *schema.Resource {
DefaultFunc: schema.EnvDefaultFunc("OS_KMS_ID", nil),
},
"extend_param": {
Type: schema.TypeString,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: "use extend_params instead",
},
"extend_params": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
}},
},
Expand Down Expand Up @@ -141,9 +148,16 @@ func ResourceCCENodePoolV3() *schema.Resource {
DefaultFunc: schema.EnvDefaultFunc("OS_KMS_ID", nil),
},
"extend_param": {
Type: schema.TypeString,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: "use extend_params instead",
},
"extend_params": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
}},
},
Expand Down Expand Up @@ -415,9 +429,10 @@ func resourceCCENodePoolV3Read(ctx context.Context, d *schema.ResourceData, meta

rootVolume := []map[string]interface{}{
{
"size": s.Spec.NodeTemplate.RootVolume.Size,
"volumetype": s.Spec.NodeTemplate.RootVolume.VolumeType,
"extend_param": s.Spec.NodeTemplate.RootVolume.ExtendParam,
"size": s.Spec.NodeTemplate.RootVolume.Size,
"volumetype": s.Spec.NodeTemplate.RootVolume.VolumeType,
"extend_params": s.Spec.NodeTemplate.RootVolume.ExtendParam,
"extend_param": "",
},
}
if s.Spec.NodeTemplate.RootVolume.Metadata != nil {
Expand Down Expand Up @@ -462,9 +477,10 @@ func resourceCCENodePoolV3Read(ctx context.Context, d *schema.ResourceData, meta
var volumes []interface{}
for _, pairObject := range s.Spec.NodeTemplate.DataVolumes {
volume := map[string]interface{}{
"size": pairObject.Size,
"volumetype": pairObject.VolumeType,
"extend_param": pairObject.ExtendParam,
"size": pairObject.Size,
"volumetype": pairObject.VolumeType,
"extend_params": pairObject.ExtendParam,
"extend_param": "",
}
if pairObject.Metadata != nil {
volume["kms_id"] = pairObject.Metadata["__system__cmkid"]
Expand Down
Expand Up @@ -149,9 +149,17 @@ func ResourceCCENodeV3() *schema.Resource {
DefaultFunc: schema.EnvDefaultFunc("OS_KMS_ID", nil),
},
"extend_param": {
Type: schema.TypeString,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: "use extend_params instead",
},
"extend_params": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
}},
},
Expand All @@ -178,9 +186,17 @@ func ResourceCCENodeV3() *schema.Resource {
DefaultFunc: schema.EnvDefaultFunc("OS_KMS_ID", nil),
},
"extend_param": {
Type: schema.TypeString,
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Deprecated: "use extend_params instead",
},
"extend_params": {
Type: schema.TypeMap,
Optional: true,
ForceNew: true,
Computed: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
}},
},
Expand Down Expand Up @@ -419,7 +435,7 @@ func resourceCCEDataVolume(d *schema.ResourceData) []nodes.VolumeSpec {
volumes[i] = nodes.VolumeSpec{
Size: rawMap["size"].(int),
VolumeType: rawMap["volumetype"].(string),
ExtendParam: rawMap["extend_param"].(string),
ExtendParam: rawMap["extend_params"].(map[string]interface{}),
}
if kmsID := rawMap["kms_id"]; kmsID != "" {
volumes[i].Metadata = map[string]interface{}{
Expand All @@ -435,10 +451,10 @@ func resourceCCERootVolume(d *schema.ResourceData) nodes.VolumeSpec {
var nics nodes.VolumeSpec
nicsRaw := d.Get("root_volume").([]interface{})
if len(nicsRaw) == 1 {
nics.Size = nicsRaw[0].(map[string]interface{})["size"].(int)
nics.VolumeType = nicsRaw[0].(map[string]interface{})["volumetype"].(string)
nics.ExtendParam = nicsRaw[0].(map[string]interface{})["extend_param"].(string)
rawMap := nicsRaw[0].(map[string]interface{})
nics.Size = rawMap["size"].(int)
nics.VolumeType = rawMap["volumetype"].(string)
nics.ExtendParam = rawMap["extend_params"].(map[string]interface{})
if kmsID := rawMap["kms_id"]; kmsID != "" {
nics.Metadata = map[string]interface{}{
"__system__cmkid": kmsID,
Expand Down Expand Up @@ -685,7 +701,8 @@ func resourceCCENodeV3Read(ctx context.Context, d *schema.ResourceData, meta int
volume := make(map[string]interface{})
volume["size"] = dataVolume.Size
volume["volumetype"] = dataVolume.VolumeType
volume["extend_param"] = dataVolume.ExtendParam
volume["extend_params"] = dataVolume.ExtendParam
volume["extend_param"] = ""
if dataVolume.Metadata != nil {
volume["kms_id"] = dataVolume.Metadata["__system__cmkid"]
}
Expand All @@ -697,9 +714,10 @@ func resourceCCENodeV3Read(ctx context.Context, d *schema.ResourceData, meta int

rootVolume := []map[string]interface{}{
{
"size": node.Spec.RootVolume.Size,
"volumetype": node.Spec.RootVolume.VolumeType,
"extend_param": node.Spec.RootVolume.ExtendParam,
"size": node.Spec.RootVolume.Size,
"volumetype": node.Spec.RootVolume.VolumeType,
"extend_params": node.Spec.RootVolume.ExtendParam,
"extend_param": "",
},
}
if node.Spec.RootVolume.Metadata != nil {
Expand Down
12 changes: 12 additions & 0 deletions releasenotes/notes/cce_nodes_volume_fix-c7dd2f17bf531321.yaml
@@ -0,0 +1,12 @@
---
deprecations:
- |
**[CCE]** Deprecate `extend_param` for `volumes` in ``resource/opentelekomcloud_cce_node_v3`` (`#2056 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2056>`_)
- |
**[CCE]** Deprecate `extend_param` for `volumes` in ``resource/opentelekomcloud_cce_node_pool_v3`` (`#2056 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2056>`_)
fixes:
- |
**[CCE]** Added `extend_params` for `volumes` in ``resource/opentelekomcloud_cce_node_v3`` (`#2056 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2056>`_)
- |
**[CCE]** Added `extend_params` for `volumes` in ``resource/opentelekomcloud_cce_node_pool_v3`` (`#2056 <https://github.com/opentelekomcloud/terraform-provider-opentelekomcloud/pull/2056>`_)

0 comments on commit ee8340b

Please sign in to comment.