Skip to content

Commit ca401b4

Browse files
modular-magicianEdward Sun
andauthored
unable to update authenticator_groups_config (#6755) (#4918)
* unable to update authenticator_groups_config Co-authored-by: Edward Sun <[email protected]> Signed-off-by: Modular Magician <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Edward Sun <[email protected]>
1 parent bb92f86 commit ca401b4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.changelog/6755.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 unable to update `authenticator_groups_config` on `google_container_cluster`
3+
```

google-beta/resource_container_cluster.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4274,9 +4274,16 @@ func expandContainerClusterAuthenticatorGroupsConfig(configured interface{}) *co
42744274
}
42754275

42764276
config := l[0].(map[string]interface{})
4277-
return &container.AuthenticatorGroupsConfig{
4278-
SecurityGroup: config["security_group"].(string),
4277+
result := &container.AuthenticatorGroupsConfig{}
4278+
if securityGroup, ok := config["security_group"]; ok {
4279+
if securityGroup == nil || securityGroup.(string) == "" {
4280+
result.Enabled = false
4281+
} else {
4282+
result.Enabled = true
4283+
result.SecurityGroup = securityGroup.(string)
4284+
}
42794285
}
4286+
return result
42804287
}
42814288

42824289
func expandNodePoolDefaults(configured interface{}) *container.NodePoolDefaults {

0 commit comments

Comments
 (0)