Skip to content

Commit

Permalink
Merge pull request #100 from niuzhenguo/add-cce-os-option
Browse files Browse the repository at this point in the history
Add os option support to CCE node
  • Loading branch information
niuzhenguo committed Apr 3, 2019
2 parents 70e082a + 60d2a97 commit 00d1912
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
8 changes: 8 additions & 0 deletions huaweicloud/resource_huaweicloud_cce_node_v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ func resourceCCENodeV3() *schema.Resource {
Required: true,
ForceNew: true,
},
"os": {
Type: schema.TypeString,
Optional: true,
ForceNew: true,
Default: "EulerOS 2.2",
},
"key_pair": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -254,6 +260,7 @@ func resourceCCENodeV3Create(d *schema.ResourceData, meta interface{}) error {
Spec: nodes.Spec{
Flavor: d.Get("flavor_id").(string),
Az: d.Get("availability_zone").(string),
Os: d.Get("os").(string),
Login: nodes.LoginSpec{SshKey: d.Get("key_pair").(string)},
RootVolume: resourceCCERootVolume(d),
DataVolumes: resourceCCEDataVolume(d),
Expand Down Expand Up @@ -360,6 +367,7 @@ func resourceCCENodeV3Read(d *schema.ResourceData, meta interface{}) error {
d.Set("annotations", s.Metadata.Annotations)
d.Set("flavor_id", s.Spec.Flavor)
d.Set("availability_zone", s.Spec.Az)
d.Set("os", s.Spec.Os)
d.Set("billing_mode", s.Spec.BillingMode)
d.Set("node_count", s.Spec.Count)
d.Set("extend_param_charging_mode", s.Spec.ExtendParam.ChargingMode)
Expand Down
3 changes: 3 additions & 0 deletions huaweicloud/resource_huaweicloud_cce_node_v3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func TestAccCCENodesV3_timeout(t *testing.T) {
Config: testAccCCENodeV3_timeout,
Check: resource.ComposeTestCheckFunc(
testAccCheckCCENodeV3Exists("huaweicloud_cce_node_v3.node_1", "huaweicloud_cce_cluster_v3.cluster_1", &node),
resource.TestCheckResourceAttr(
"huaweicloud_cce_node_v3.node_1", "os", "CentOS 7.1"),
),
},
},
Expand Down Expand Up @@ -209,6 +211,7 @@ resource "huaweicloud_cce_node_v3" "node_1" {
iptype="5_bgp"
billing_mode=0
availability_zone= "%s"
os= "CentOS 7.1"
key_pair="%s"
root_volume = {
size= 40,
Expand Down

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

6 changes: 3 additions & 3 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1329,10 +1329,10 @@
"revisionTime": "2019-03-29T01:54:31Z"
},
{
"checksumSHA1": "xDEoWEA9ygauLBKnsNzsa1XKvOc=",
"checksumSHA1": "5eXOI16i+tXYk/hFLOB8r+mTgdU=",
"path": "github.com/huaweicloud/golangsdk/openstack/cce/v3/nodes",
"revision": "fdea87e5a2d61c3072101509ebd93f755d9cbc4f",
"revisionTime": "2018-07-20T15:04:31Z"
"revision": "49551ba13819e06f9cf2273e498f59efa6dff3c4",
"revisionTime": "2019-04-02T09:21:00Z"
},
{
"checksumSHA1": "q1aqMo0piceUY8M6d6xzbL1mgdo=",
Expand Down
3 changes: 3 additions & 0 deletions website/docs/r/cce_nodes_v3.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ The following arguments are supported:

* `availability_zone` - (Required) specify the name of the available partition (AZ). Changing this parameter will create a new resource.

* `os` - (Optional) Operating System of the node, possible values are EulerOS 2.2 and CentOS 7.1. Defaults to EulerOS 2.2.
Changing this parameter will create a new resource.

* `key_pair` - (Required) Key pair name when logging in to select the key pair mode. Changing this parameter will create a new resource.

* `eip_ids` - (Optional) List of existing elastic IP IDs. Changing this parameter will create a new resource.
Expand Down

0 comments on commit 00d1912

Please sign in to comment.