diff --git a/go.mod b/go.mod index 74d587a760..385a13dbf6 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/hashicorp/errwrap v1.0.0 github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/terraform-plugin-sdk v1.13.0 - github.com/huaweicloud/golangsdk v0.0.0-20200918094425-73d215220e84 + github.com/huaweicloud/golangsdk v0.0.0-20200919091224-7337da385ad9 github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a github.com/mitchellh/go-homedir v1.1.0 github.com/smartystreets/goconvey v0.0.0-20190222223459-a17d461953aa // indirect diff --git a/go.sum b/go.sum index a9d020b46c..7be40aa51b 100644 --- a/go.sum +++ b/go.sum @@ -129,10 +129,8 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/huaweicloud/golangsdk v0.0.0-20200914125232-fb334938cae6 h1:XDiJbxy/MlG1d7Ac8bgq8cNxvnfPoTcC6dLd9WwTf8A= -github.com/huaweicloud/golangsdk v0.0.0-20200914125232-fb334938cae6/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0= -github.com/huaweicloud/golangsdk v0.0.0-20200918094425-73d215220e84 h1:r7WkRwI2eC6eW1X1vq3FTzN80yjrGBjIaWgE+1A6M0I= -github.com/huaweicloud/golangsdk v0.0.0-20200918094425-73d215220e84/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0= +github.com/huaweicloud/golangsdk v0.0.0-20200919091224-7337da385ad9 h1:gVFOIhcTFWQY6bPlyUgwX8OHEmpXMXSss1m/PwiWnuE= +github.com/huaweicloud/golangsdk v0.0.0-20200919091224-7337da385ad9/go.mod h1:fcOI5u+0f62JtJd7zkCch/Z57BNC6bhqb32TKuiF4r0= github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a h1:FyS/ubzBR5xJlnJGRTwe7GUHpJOR4ukYK3y+LFNffuA= github.com/jen20/awspolicyequivalence v0.0.0-20170831201602-3d48364a137a/go.mod h1:uoIMjNxUfXi48Ci40IXkPRbghZ1vbti6v9LCbNqRgHY= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= diff --git a/huaweicloud/resource_huaweicloud_cce_node_pool.go b/huaweicloud/resource_huaweicloud_cce_node_pool.go index 12cf86c321..e323ae0f31 100644 --- a/huaweicloud/resource_huaweicloud_cce_node_pool.go +++ b/huaweicloud/resource_huaweicloud_cce_node_pool.go @@ -43,6 +43,11 @@ func resourceCCENodePool() *schema.Resource { Required: true, ForceNew: true, }, + "type": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, "root_volume": { Type: schema.TypeList, Required: true, @@ -225,6 +230,7 @@ func resourceCCENodePoolCreate(d *schema.ResourceData, meta interface{}) error { Name: d.Get("name").(string), }, Spec: nodepools.CreateSpec{ + Type: d.Get("type").(string), NodeTemplate: nodes.Spec{ Flavor: d.Get("flavor_id").(string), Az: d.Get("availability_zone").(string), diff --git a/huaweicloud/resource_huaweicloud_cce_node_pool_test.go b/huaweicloud/resource_huaweicloud_cce_node_pool_test.go index d4eb26d8c2..3a4e404c09 100644 --- a/huaweicloud/resource_huaweicloud_cce_node_pool_test.go +++ b/huaweicloud/resource_huaweicloud_cce_node_pool_test.go @@ -158,6 +158,7 @@ resource "huaweicloud_cce_node_pool" "test" { max_node_count = 0 scale_down_cooldown_time = 0 priority = 0 + type = "vm" root_volume { size = 40 @@ -188,6 +189,7 @@ resource "huaweicloud_cce_node_pool" "test" { max_node_count = 9 scale_down_cooldown_time = 100 priority = 1 + type = "vm" root_volume { size = 40 diff --git a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/nodepools/requests.go b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/nodepools/requests.go index e218a32f93..2f039ec1d3 100644 --- a/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/nodepools/requests.go +++ b/vendor/github.com/huaweicloud/golangsdk/openstack/cce/v3/nodepools/requests.go @@ -108,6 +108,8 @@ type CreateMetaData struct { // CreateSpec describes Node pools specification type CreateSpec struct { + //Node pool type + Type string `json:"type" required:"true"` // Node template NodeTemplate nodes.Spec `json:"nodeTemplate" required:"true"` // Initial number of expected nodes diff --git a/vendor/modules.txt b/vendor/modules.txt index b3412bb805..f37ae8cfe0 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -186,7 +186,7 @@ github.com/hashicorp/terraform-svchost/auth github.com/hashicorp/terraform-svchost/disco # github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d github.com/hashicorp/yamux -# github.com/huaweicloud/golangsdk v0.0.0-20200918094425-73d215220e84 +# github.com/huaweicloud/golangsdk v0.0.0-20200919091224-7337da385ad9 ## explicit github.com/huaweicloud/golangsdk github.com/huaweicloud/golangsdk/internal diff --git a/website/docs/r/cce_node_pool.html.md b/website/docs/r/cce_node_pool.html.md index 363c12fa61..b8411d830f 100644 --- a/website/docs/r/cce_node_pool.html.md +++ b/website/docs/r/cce_node_pool.html.md @@ -30,6 +30,7 @@ resource "huaweicloud_cce_node_pool" "node_pool" { max_node_count = 10 scale_down_cooldown_time = 100 priority = 1 + type = "vm" root_volume { size = 40 @@ -52,6 +53,8 @@ The following arguments are supported: * `initial_node_count` - (Required) Initial number of expected nodes in the node pool. * `flavor_id` - (Required) Specifies the flavor id. Changing this parameter will create a new resource. + +* `type` - (Required) Node Pool type. This is an enumerated value, the possible values are {"vm", "ElasticBMS"}. * `availability_zone` - (Optional) specify the name of the available partition (AZ). Default value is random to create nodes in a random AZ in the node pool.