Skip to content

Commit

Permalink
fix(k8s): pool size and autoscaling (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4d1 authored Jun 12, 2020
1 parent e365d6b commit f2f5c71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 9 additions & 1 deletion scaleway/resource_k8s_pool_beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func resourceScalewayK8SPoolBeta() *schema.Resource {
Computed: true,
Description: "The Kubernetes version of the pool",
},
"current_size": {
Type: schema.TypeInt,
Computed: true,
Description: "The actual size of the pool",
},
"nodes": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -266,7 +271,10 @@ func resourceScalewayK8SPoolBetaRead(d *schema.ResourceData, m interface{}) erro
_ = d.Set("node_type", pool.NodeType)
_ = d.Set("autoscaling", pool.Autoscaling)
_ = d.Set("autohealing", pool.Autohealing)
_ = d.Set("size", pool.Size)
_ = d.Set("current_size", pool.Size)
if !pool.Autoscaling {
_ = d.Set("size", pool.Size)
}
_ = d.Set("version", pool.Version)
_ = d.Set("min_size", pool.MinSize)
_ = d.Set("max_size", pool.MaxSize)
Expand Down
2 changes: 2 additions & 0 deletions website/docs/r/k8s_pool_beta.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ The following arguments are supported:
~> **Important:** Updates to this field will recreate a new resource.

- `size` - (Required) The size of the pool.
~> **Important:** This field will only be used at creation if autoscaling is enabled.

- `min_size` - (Defaults to `1`) The minimum size of the pool, used by the autoscaling feature.

Expand Down Expand Up @@ -83,6 +84,7 @@ In addition to all above arguments, the following attributes are exported:
- `created_at` - The creation date of the pool.
- `updated_at` - The last update date of the pool.
- `version` - The version of the pool.
- `current_size` - The size of the pool at the time the terraform state was updated.

## Import

Expand Down

0 comments on commit f2f5c71

Please sign in to comment.