From 6428e34927095ed2614aab1a960c06aea927af8b Mon Sep 17 00:00:00 2001 From: "belokobylskii.i" Date: Mon, 16 Dec 2024 15:13:39 +0300 Subject: [PATCH] fix autoscale from zero --- selectel/resource_selectel_mks_nodegroup_v1.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/selectel/resource_selectel_mks_nodegroup_v1.go b/selectel/resource_selectel_mks_nodegroup_v1.go index ed37f9fa..d56dcf1a 100644 --- a/selectel/resource_selectel_mks_nodegroup_v1.go +++ b/selectel/resource_selectel_mks_nodegroup_v1.go @@ -279,9 +279,8 @@ func resourceMKSNodegroupV1Create(ctx context.Context, d *schema.ResourceData, m if v, ok := d.GetOk("enable_autoscale"); ok { enableAutoscale := v.(bool) createOpts.EnableAutoscale = &enableAutoscale - } - if v, ok := d.GetOk("autoscale_min_nodes"); ok { - autoscaleMinNodes := v.(int) + // d.GetOk returns false on zero-value. + autoscaleMinNodes := d.Get("autoscale_min_nodes").(int) createOpts.AutoscaleMinNodes = &autoscaleMinNodes } if v, ok := d.GetOk("autoscale_max_nodes"); ok {