Skip to content

Commit 7b24abf

Browse files
modular-magicianshuyama1
authored andcommitted
Revert "Support new features of IGM.updatePolicy (#4956)" (#5964) (#4247)
This reverts commit 31d1d1663e8b5912730cb7009b379c338bad3723. Signed-off-by: Modular Magician <[email protected]>
1 parent 1272a41 commit 7b24abf

7 files changed

+32
-56
lines changed

.changelog/5964.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:none
2+
```

google-beta/resource_compute_instance_group_manager.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,15 +201,8 @@ func resourceComputeInstanceGroupManager() *schema.Resource {
201201
"minimal_action": {
202202
Type: schema.TypeString,
203203
Required: true,
204-
ValidateFunc: validation.StringInSlice([]string{"REFRESH", "RESTART", "REPLACE"}, false),
205-
Description: `Minimal action to be taken on an instance. You can specify either REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.`,
206-
},
207-
208-
"most_disruptive_allowed_action": {
209-
Type: schema.TypeString,
210-
Optional: true,
211-
ValidateFunc: validation.StringInSlice([]string{"NONE", "REFRESH", "RESTART", "REPLACE"}, false),
212-
Description: `Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.`,
204+
ValidateFunc: validation.StringInSlice([]string{"RESTART", "REPLACE"}, false),
205+
Description: `Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.`,
213206
},
214207

215208
"type": {
@@ -919,7 +912,6 @@ func expandUpdatePolicy(configured []interface{}) *compute.InstanceGroupManagerU
919912
data := raw.(map[string]interface{})
920913

921914
updatePolicy.MinimalAction = data["minimal_action"].(string)
922-
updatePolicy.MostDisruptiveAllowedAction = data["most_disruptive_allowed_action"].(string)
923915
updatePolicy.Type = data["type"].(string)
924916
updatePolicy.ReplacementMethod = data["replacement_method"].(string)
925917
updatePolicy.MinReadySec = int64(data["min_ready_sec"].(int))
@@ -1007,7 +999,6 @@ func flattenUpdatePolicy(updatePolicy *compute.InstanceGroupManagerUpdatePolicy)
1007999
}
10081000
up["min_ready_sec"] = updatePolicy.MinReadySec
10091001
up["minimal_action"] = updatePolicy.MinimalAction
1010-
up["most_disruptive_allowed_action"] = updatePolicy.MostDisruptiveAllowedAction
10111002
up["type"] = updatePolicy.Type
10121003
up["replacement_method"] = updatePolicy.ReplacementMethod
10131004
results = append(results, up)

google-beta/resource_compute_instance_group_manager_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -932,11 +932,10 @@ resource "google_compute_instance_group_manager" "igm-rolling-update-policy" {
932932
zone = "us-central1-c"
933933
target_size = 3
934934
update_policy {
935-
type = "PROACTIVE"
936-
minimal_action = "REPLACE"
937-
most_disruptive_allowed_action = "REPLACE"
938-
max_surge_fixed = 2
939-
max_unavailable_fixed = 2
935+
type = "PROACTIVE"
936+
minimal_action = "REPLACE"
937+
max_surge_fixed = 2
938+
max_unavailable_fixed = 2
940939
}
941940
named_port {
942941
name = "customhttp"

google-beta/resource_compute_region_instance_group_manager.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,8 @@ func resourceComputeRegionInstanceGroupManager() *schema.Resource {
239239
"minimal_action": {
240240
Type: schema.TypeString,
241241
Required: true,
242-
ValidateFunc: validation.StringInSlice([]string{"REFRESH", "RESTART", "REPLACE"}, false),
243-
Description: `Minimal action to be taken on an instance. You can specify either REFRESH to update without stopping instances, RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a REFRESH, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.`,
244-
},
245-
246-
"most_disruptive_allowed_action": {
247-
Type: schema.TypeString,
248-
Optional: true,
249-
ValidateFunc: validation.StringInSlice([]string{"NONE", "REFRESH", "RESTART", "REPLACE"}, false),
250-
Description: `Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.`,
242+
ValidateFunc: validation.StringInSlice([]string{"RESTART", "REPLACE"}, false),
243+
Description: `Minimal action to be taken on an instance. You can specify either RESTART to restart existing instances or REPLACE to delete and create new instances from the target template. If you specify a RESTART, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.`,
251244
},
252245

253246
"type": {
@@ -775,7 +768,6 @@ func expandRegionUpdatePolicy(configured []interface{}) *compute.InstanceGroupMa
775768
data := raw.(map[string]interface{})
776769

777770
updatePolicy.MinimalAction = data["minimal_action"].(string)
778-
updatePolicy.MostDisruptiveAllowedAction = data["most_disruptive_allowed_action"].(string)
779771
updatePolicy.Type = data["type"].(string)
780772
updatePolicy.InstanceRedistributionType = data["instance_redistribution_type"].(string)
781773
updatePolicy.ReplacementMethod = data["replacement_method"].(string)
@@ -835,7 +827,6 @@ func flattenRegionUpdatePolicy(updatePolicy *compute.InstanceGroupManagerUpdateP
835827
}
836828
up["min_ready_sec"] = updatePolicy.MinReadySec
837829
up["minimal_action"] = updatePolicy.MinimalAction
838-
up["most_disruptive_allowed_action"] = updatePolicy.MostDisruptiveAllowedAction
839830
up["type"] = updatePolicy.Type
840831
up["instance_redistribution_type"] = updatePolicy.InstanceRedistributionType
841832
up["replacement_method"] = updatePolicy.ReplacementMethod

google-beta/resource_compute_region_instance_group_manager_test.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,14 +1294,13 @@ resource "google_compute_region_instance_group_manager" "igm-rolling-update-poli
12941294
distribution_policy_zones = ["us-central1-a", "us-central1-f"]
12951295
target_size = 3
12961296
update_policy {
1297-
type = "PROACTIVE"
1298-
instance_redistribution_type = "NONE"
1299-
minimal_action = "REPLACE"
1300-
most_disruptive_allowed_action = "REPLACE"
1301-
max_surge_fixed = 0
1302-
max_unavailable_fixed = 2
1303-
min_ready_sec = 10
1304-
replacement_method = "RECREATE"
1297+
type = "PROACTIVE"
1298+
instance_redistribution_type = "NONE"
1299+
minimal_action = "REPLACE"
1300+
max_surge_fixed = 0
1301+
max_unavailable_fixed = 2
1302+
min_ready_sec = 10
1303+
replacement_method = "RECREATE"
13051304
}
13061305
named_port {
13071306
name = "customhttp"

website/docs/r/compute_instance_group_manager.html.markdown

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -149,19 +149,16 @@ group. You can specify only one value. Structure is [documented below](#nested_a
149149

150150
```hcl
151151
update_policy {
152-
type = "PROACTIVE"
153-
minimal_action = "REPLACE"
154-
most_disruptive_allowed_action = "REPLACE"
155-
max_surge_percent = 20
156-
max_unavailable_fixed = 2
157-
min_ready_sec = 50
158-
replacement_method = "RECREATE"
152+
type = "PROACTIVE"
153+
minimal_action = "REPLACE"
154+
max_surge_percent = 20
155+
max_unavailable_fixed = 2
156+
min_ready_sec = 50
157+
replacement_method = "RECREATE"
159158
}
160159
```
161160

162-
* `minimal_action` - (Required) - Minimal action to be taken on an instance. You can specify either `REFRESH` to update without stopping instances, `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `REFRESH`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
163-
164-
* `most_disruptive_allowed_action` - (Optional) - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.
161+
* `minimal_action` - (Required) - Minimal action to be taken on an instance. You can specify either `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `RESTART`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
165162

166163
* `type` - (Required) - The type of update process. You can specify either `PROACTIVE` so that the instance group manager proactively executes actions in order to bring instances to their target versions or `OPPORTUNISTIC` so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
167164

website/docs/r/compute_region_instance_group_manager.html.markdown

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,17 @@ group. You can specify one or more values. For more information, see the [offici
158158

159159
```hcl
160160
update_policy {
161-
type = "PROACTIVE"
162-
instance_redistribution_type = "PROACTIVE"
163-
minimal_action = "REPLACE"
164-
most_disruptive_allowed_action = "REPLACE"
165-
max_surge_percent = 20
166-
max_unavailable_fixed = 2
167-
min_ready_sec = 50
168-
replacement_method = "RECREATE"
161+
type = "PROACTIVE"
162+
instance_redistribution_type = "PROACTIVE"
163+
minimal_action = "REPLACE"
164+
max_surge_percent = 20
165+
max_unavailable_fixed = 2
166+
min_ready_sec = 50
167+
replacement_method = "RECREATE"
169168
}
170169
```
171170

172-
* `minimal_action` - (Required) - Minimal action to be taken on an instance. You can specify either `REFRESH` to update without stopping instances, `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `REFRESH`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
173-
174-
* `most_disruptive_allowed_action` - (Optional) - Most disruptive action that is allowed to be taken on an instance. You can specify either NONE to forbid any actions, REFRESH to allow actions that do not need instance restart, RESTART to allow actions that can be applied without instance replacing or REPLACE to allow all possible actions. If the Updater determines that the minimal update action needed is more disruptive than most disruptive allowed action you specify it will not perform the update at all.
171+
* `minimal_action` - (Required) - Minimal action to be taken on an instance. You can specify either `RESTART` to restart existing instances or `REPLACE` to delete and create new instances from the target template. If you specify a `RESTART`, the Updater will attempt to perform that action only. However, if the Updater determines that the minimal action you specify is not enough to perform the update, it might perform a more disruptive action.
175172

176173
* `type` - (Required) - The type of update process. You can specify either `PROACTIVE` so that the instance group manager proactively executes actions in order to bring instances to their target versions or `OPPORTUNISTIC` so that no action is proactively executed but the update will be performed as part of other actions (for example, resizes or recreateInstances calls).
177174

0 commit comments

Comments
 (0)