-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edward Sun
committed
Jul 17, 2022
1 parent
b720f35
commit f10ed1b
Showing
2 changed files
with
90 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -635,15 +635,13 @@ func resourceContainerCluster() *schema.Resource { | |
Type: schema.TypeList, | ||
Optional: true, | ||
Computed: true, | ||
ForceNew: true, | ||
MaxItems: 1, | ||
Description: `Configuration for the Google Groups for GKE feature.`, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"security_group": { | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
Description: `The name of the RBAC security group for use with Google security groups in Kubernetes RBAC. Group name must be in format [email protected].`, | ||
}, | ||
}, | ||
|
@@ -2381,6 +2379,21 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er | |
} | ||
<% end -%> | ||
|
||
if d.HasChange("authenticator_groups_config") { | ||
req := &container.UpdateClusterRequest{ | ||
Update: &container.ClusterUpdate{ | ||
DesiredAuthenticatorGroupsConfig: expandContainerClusterAuthenticatorGroupsConfig(d.Get("authenticator_groups_config")), | ||
}, | ||
} | ||
updateF := updateFunc(req, "updating GKE cluster authenticator groups config") | ||
// Call update serially. | ||
if err := lockedCall(lockKey, updateF); err != nil { | ||
return err | ||
} | ||
|
||
log.Printf("[INFO] GKE cluster %s authenticator groups config has been updated", d.Id()) | ||
} | ||
|
||
if d.HasChange("default_snat_status") { | ||
req := &container.UpdateClusterRequest{ | ||
Update: &container.ClusterUpdate{ | ||
|
@@ -3829,6 +3842,18 @@ func expandContainerClusterTpuConfig(configured interface{}) *container.TpuConfi | |
} | ||
<% end -%> | ||
|
||
func expandContainerClusterAuthenticatorGroupsConfig(configured interface{}) *container.AuthenticatorGroupsConfig { | ||
l := configured.([]interface{}) | ||
if len(l) == 0 || l[0] == nil { | ||
return nil | ||
} | ||
|
||
config := l[0].(map[string]interface{}) | ||
return &container.AuthenticatorGroupsConfig{ | ||
SecurityGroup: config["security_group"].(string), | ||
} | ||
} | ||
|
||
func flattenNotificationConfig(c *container.NotificationConfig) []map[string]interface{} { | ||
if c == nil { | ||
return nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters