From 2e806b91533d89f0ec95f17ad2cc23becf91cd4c Mon Sep 17 00:00:00 2001 From: Ryan Moriarty Date: Tue, 12 Dec 2023 23:21:21 +0000 Subject: [PATCH] move fn for diff readability --- .../resource_container_cluster.go.erb | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb index c9b61bb8e4dd..0abf846798af 100644 --- a/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb +++ b/mmv1/third_party/terraform/services/container/resource_container_cluster.go.erb @@ -2988,22 +2988,6 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s's autopilot workload policy config allow_net_admin has been set to %v", d.Id(), allowed) } - if d.HasChange("binary_authorization") || d.HasChange("enable_binary_authorization") { - req := &container.UpdateClusterRequest{ - Update: &container.ClusterUpdate{ - DesiredBinaryAuthorization: expandBinaryAuthorization(d.Get("binary_authorization"), d.Get("enable_binary_authorization").(bool)), - }, - } - - updateF := updateFunc(req, "updating GKE binary authorization") - // Call update serially. - if err := transport_tpg.LockedCall(lockKey, updateF); err != nil { - return err - } - - log.Printf("[INFO] GKE cluster %s's binary authorization has been updated to %v", d.Id(), req.Update.DesiredBinaryAuthorization) - } - if d.HasChange("private_cluster_config.0.enable_private_endpoint") { enabled := d.Get("private_cluster_config.0.enable_private_endpoint").(bool) req := &container.UpdateClusterRequest{ @@ -3042,6 +3026,22 @@ func resourceContainerClusterUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[INFO] GKE cluster %s's master global access config has been updated to %v", d.Id(), config) } + if d.HasChange("binary_authorization") || d.HasChange("enable_binary_authorization") { + req := &container.UpdateClusterRequest{ + Update: &container.ClusterUpdate{ + DesiredBinaryAuthorization: expandBinaryAuthorization(d.Get("binary_authorization"), d.Get("enable_binary_authorization").(bool)), + }, + } + + updateF := updateFunc(req, "updating GKE binary authorization") + // Call update serially. + if err := transport_tpg.LockedCall(lockKey, updateF); err != nil { + return err + } + + log.Printf("[INFO] GKE cluster %s's binary authorization has been updated to %v", d.Id(), req.Update.DesiredBinaryAuthorization) + } + if d.HasChange("enable_shielded_nodes") { enabled := d.Get("enable_shielded_nodes").(bool) req := &container.UpdateClusterRequest{