Skip to content

Commit 7af5d1a

Browse files
fix(container): fix a bug in GKE blue green upgrade policy (#16239) (#11464)
[upstream:99e25018be593e95bfd4b80c5fd00c4daad38d15] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 8d23d9b commit 7af5d1a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.changelog/16239.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:bug
2+
container: fixed a bug in `google_container_node_pool` that prevented creation when `blue_green_settings` was specified
3+
```

google-beta/services/container/resource_container_node_pool.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,8 +1259,8 @@ func expandNodePool(d *schema.ResourceData, prefix string) (*container.NodePool,
12591259
return nil, fmt.Errorf("Blue-green upgrade settings may not be changed when blue-green strategy is not enabled")
12601260
}
12611261

1262-
if _, ok1 := blueGreenSettingsConfig["standard_rollout_policy"]; ok1 {
1263-
if _, ok2 := blueGreenSettingsConfig["autoscaled_rollout_policy"]; ok2 {
1262+
if s, ok1 := blueGreenSettingsConfig["standard_rollout_policy"]; ok1 && len(s.([]interface{})) > 0 {
1263+
if a, ok2 := blueGreenSettingsConfig["autoscaled_rollout_policy"]; ok2 && len(a.([]interface{})) > 0 {
12641264
return nil, fmt.Errorf("`standard_rollout_policy` and `autoscaled_rollout_policy` cannot be set at the same time")
12651265
}
12661266
}

0 commit comments

Comments
 (0)