Skip to content

Commit

Permalink
add required parameter type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason-Zhang9309 committed Sep 19, 2020
1 parent d762b69 commit 30598b3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 6 additions & 0 deletions huaweicloud/resource_huaweicloud_cce_node_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions huaweicloud/resource_huaweicloud_cce_node_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/cce_node_pool.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit 30598b3

Please sign in to comment.