From 23229201eccf6922ea6925ea0a02343789c1748c Mon Sep 17 00:00:00 2001 From: Riley Karson Date: Fri, 29 Oct 2021 14:05:20 -0700 Subject: [PATCH] Force-send min_ready_sec --- .../resource_compute_instance_group_manager.go.erb | 10 ++++------ ...source_compute_region_instance_group_manager.go.erb | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/mmv1/third_party/terraform/resources/resource_compute_instance_group_manager.go.erb b/mmv1/third_party/terraform/resources/resource_compute_instance_group_manager.go.erb index 761d2dcab928..69198c44d6ef 100644 --- a/mmv1/third_party/terraform/resources/resource_compute_instance_group_manager.go.erb +++ b/mmv1/third_party/terraform/resources/resource_compute_instance_group_manager.go.erb @@ -928,6 +928,10 @@ func expandUpdatePolicy(configured []interface{}) *compute.InstanceGroupManagerU updatePolicy.MinimalAction = data["minimal_action"].(string) updatePolicy.Type = data["type"].(string) updatePolicy.ReplacementMethod = data["replacement_method"].(string) +<% unless version == "ga" -%> + updatePolicy.MinReadySec = int64(data["min_ready_sec"].(int)) + updatePolicy.ForceSendFields = []string{"MinReadySec"} +<% end -%> // percent and fixed values are conflicting // when the percent values are set, the fixed values will be ignored @@ -958,12 +962,6 @@ func expandUpdatePolicy(configured []interface{}) *compute.InstanceGroupManagerU NullFields: []string{"Percent"}, } } - -<% unless version == "ga" -%> - if v, ok := data["min_ready_sec"]; ok { - updatePolicy.MinReadySec = int64(v.(int)) - } -<% end -%> } return updatePolicy } diff --git a/mmv1/third_party/terraform/resources/resource_compute_region_instance_group_manager.go.erb b/mmv1/third_party/terraform/resources/resource_compute_region_instance_group_manager.go.erb index 1faa85cc8eb9..57b53f5701b8 100644 --- a/mmv1/third_party/terraform/resources/resource_compute_region_instance_group_manager.go.erb +++ b/mmv1/third_party/terraform/resources/resource_compute_region_instance_group_manager.go.erb @@ -785,6 +785,10 @@ func expandRegionUpdatePolicy(configured []interface{}) *compute.InstanceGroupMa updatePolicy.Type = data["type"].(string) updatePolicy.InstanceRedistributionType = data["instance_redistribution_type"].(string) updatePolicy.ReplacementMethod = data["replacement_method"].(string) +<% unless version == "ga" -%> + updatePolicy.MinReadySec = int64(data["min_ready_sec"].(int)) + updatePolicy.ForceSendFields = []string{"MinReadySec"} +<% end -%> // percent and fixed values are conflicting // when the percent values are set, the fixed values will be ignored @@ -815,12 +819,6 @@ func expandRegionUpdatePolicy(configured []interface{}) *compute.InstanceGroupMa NullFields: []string{"Percent"}, } } - -<% unless version == "ga" -%> - if v, ok := data["min_ready_sec"]; ok { - updatePolicy.MinReadySec = int64(v.(int)) - } -<% end -%> } return updatePolicy }