From b3aa458ec738ecee7cc63907bded1e0a661b20ea Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Thu, 21 Nov 2019 16:38:39 -0800 Subject: [PATCH 1/4] Container cluster authenticator_groups_config is now GA --- .../resources/resource_container_cluster.go.erb | 10 ++++------ .../tests/resource_container_cluster_test.go.erb | 2 -- .../website/docs/r/container_cluster.html.markdown | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/third_party/terraform/resources/resource_container_cluster.go.erb b/third_party/terraform/resources/resource_container_cluster.go.erb index 0cf3342d9c5e..82c9e0ee5179 100644 --- a/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/third_party/terraform/resources/resource_container_cluster.go.erb @@ -379,6 +379,7 @@ func resourceContainerCluster() *schema.Resource { Optional: true, Default: false, }, +<% end -%> "authenticator_groups_config": { Type: schema.TypeList, @@ -396,7 +397,6 @@ func resourceContainerCluster() *schema.Resource { }, }, }, -<% end -%> "initial_node_count": { Type: schema.TypeInt, @@ -1091,11 +1091,9 @@ func resourceContainerClusterCreate(d *schema.ResourceData, meta interface{}) er cluster.NodeConfig = expandNodeConfig(v) } -<% unless version == 'ga' -%> if v, ok := d.GetOk("authenticator_groups_config"); ok { cluster.AuthenticatorGroupsConfig = expandAuthenticatorGroupsConfig(v) } -<% end -%> if v, ok := d.GetOk("private_cluster_config"); ok { cluster.PrivateClusterConfig = expandPrivateClusterConfig(v) @@ -1252,9 +1250,6 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro if err := d.Set("cluster_autoscaling", flattenClusterAutoscaling(cluster.Autoscaling)); err != nil { return err } - if err := d.Set("authenticator_groups_config", flattenAuthenticatorGroupsConfig(cluster.AuthenticatorGroupsConfig)); err != nil { - return err - } if err := d.Set("release_channel", flattenReleaseChannel(cluster.ReleaseChannel)); err != nil { return err } @@ -1264,6 +1259,9 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro return err } <% end -%> + if err := d.Set("authenticator_groups_config", flattenAuthenticatorGroupsConfig(cluster.AuthenticatorGroupsConfig)); err != nil { + return err + } if cluster.DefaultMaxPodsConstraint != nil { d.Set("default_max_pods_per_node", cluster.DefaultMaxPodsConstraint.MaxPodsPerNode) } diff --git a/third_party/terraform/tests/resource_container_cluster_test.go.erb b/third_party/terraform/tests/resource_container_cluster_test.go.erb index f74a52afdebc..b77c59d57468 100644 --- a/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -1961,7 +1961,6 @@ resource "google_container_cluster" "with_network_policy_enabled" { `, clusterName) } -<% unless version == 'ga' -%> func testAccContainerCluster_withAuthenticatorGroupsConfig(clusterName string) string { return fmt.Sprintf(` resource "google_compute_network" "container_network" { @@ -2005,7 +2004,6 @@ resource "google_container_cluster" "with_authenticator_groups" { } `, clusterName, clusterName) } -<% end -%> func testAccContainerCluster_withMasterAuthorizedNetworksConfig(clusterName string, cidrs []string, emptyValue string) string { diff --git a/third_party/terraform/website/docs/r/container_cluster.html.markdown b/third_party/terraform/website/docs/r/container_cluster.html.markdown index c5e523026669..c35b0a0913d9 100644 --- a/third_party/terraform/website/docs/r/container_cluster.html.markdown +++ b/third_party/terraform/website/docs/r/container_cluster.html.markdown @@ -258,7 +258,7 @@ region are guaranteed to support the same version. [PodSecurityPolicy](https://cloud.google.com/kubernetes-engine/docs/how-to/pod-security-policies) feature. Structure is documented below. -* `authenticator_groups_config` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) Configuration for the +* `authenticator_groups_config` - (Optional) Configuration for the [Google Groups for GKE](https://cloud.google.com/kubernetes-engine/docs/how-to/role-based-access-control#groups-setup-gsuite) feature. Structure is documented below. From 8aaa41b4d2254cc6c6dc5e9c9c0336e442fc212e Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Thu, 21 Nov 2019 16:40:38 -0800 Subject: [PATCH 2/4] GA the methods as well --- .../terraform/resources/resource_container_cluster.go.erb | 4 ---- 1 file changed, 4 deletions(-) diff --git a/third_party/terraform/resources/resource_container_cluster.go.erb b/third_party/terraform/resources/resource_container_cluster.go.erb index 82c9e0ee5179..3cef6da6644b 100644 --- a/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/third_party/terraform/resources/resource_container_cluster.go.erb @@ -2279,7 +2279,6 @@ func expandClusterAutoscaling(configured interface{}, d *schema.ResourceData) *c } <% end -%> -<% unless version == 'ga' -%> func expandAuthenticatorGroupsConfig(configured interface{}) *containerBeta.AuthenticatorGroupsConfig { l := configured.([]interface{}) if len(l) == 0 { @@ -2293,7 +2292,6 @@ func expandAuthenticatorGroupsConfig(configured interface{}) *containerBeta.Auth } return result } -<% end -%> func expandMasterAuth(configured interface{}) *containerBeta.MasterAuth { l := configured.([]interface{}) @@ -2558,7 +2556,6 @@ func flattenClusterNodePools(d *schema.ResourceData, config *Config, c []*contai return nodePools, nil } -<% unless version == 'ga' -%> func flattenAuthenticatorGroupsConfig(c *containerBeta.AuthenticatorGroupsConfig) []map[string]interface{} { if c == nil { return nil @@ -2569,7 +2566,6 @@ func flattenAuthenticatorGroupsConfig(c *containerBeta.AuthenticatorGroupsConfig }, } } -<% end -%> func flattenPrivateClusterConfig(c *containerBeta.PrivateClusterConfig) []map[string]interface{} { if c == nil { From 4a8a691b50b2b172f7508df12d1210ff129b0959 Mon Sep 17 00:00:00 2001 From: Sam Levenick Date: Thu, 21 Nov 2019 16:53:37 -0800 Subject: [PATCH 3/4] GA test --- .../terraform/tests/resource_container_cluster_test.go.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/third_party/terraform/tests/resource_container_cluster_test.go.erb b/third_party/terraform/tests/resource_container_cluster_test.go.erb index b77c59d57468..c4e3f703a7f6 100644 --- a/third_party/terraform/tests/resource_container_cluster_test.go.erb +++ b/third_party/terraform/tests/resource_container_cluster_test.go.erb @@ -196,7 +196,6 @@ func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) { }) } -<% unless version == 'ga' -%> func TestAccContainerCluster_withAuthenticatorGroupsConfig(t *testing.T) { t.Parallel() clusterName := fmt.Sprintf("cluster-test-%s", acctest.RandString(10)) @@ -216,7 +215,6 @@ func TestAccContainerCluster_withAuthenticatorGroupsConfig(t *testing.T) { }, }) } -<% end -%> func TestAccContainerCluster_withNetworkPolicyEnabled(t *testing.T) { t.Parallel() From 3fc874345dba727159b16e67b279a6bb3ed26a4a Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 22 Nov 2019 18:39:46 +0000 Subject: [PATCH 4/4] Update tracked submodules -> HEAD on Fri Nov 22 18:39:46 UTC 2019 Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec. --- build/terraform | 2 +- build/terraform-beta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/terraform b/build/terraform index 87cc23d350e5..b9b0b099fde8 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit 87cc23d350e5696d18f5b48228c374f5d76e0296 +Subproject commit b9b0b099fde8e4ff807d2acfd13cb8bd2ecb9f30 diff --git a/build/terraform-beta b/build/terraform-beta index ba205574f1c3..e15dd93ec650 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit ba205574f1c335ed7e4f21e09a4ec6e28a8f1e00 +Subproject commit e15dd93ec650db20c8d1b269c2ea045819e96710