From e70cf43e794546c42852d948cd0ddb995d165409 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Mon, 10 Dec 2018 15:48:43 -0800 Subject: [PATCH 1/3] adding tpu cidr block output to container cluster --- .../terraform/resources/resource_container_cluster.go.erb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/third_party/terraform/resources/resource_container_cluster.go.erb b/third_party/terraform/resources/resource_container_cluster.go.erb index c8c519282d33..6522a992ff73 100644 --- a/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/third_party/terraform/resources/resource_container_cluster.go.erb @@ -271,6 +271,13 @@ func resourceContainerCluster() *schema.Resource { <% end -%> }, +<% unless version == 'ga' -%> + "tpu_ipv4_cidr_block": { + Computed: true, + Type: schema.TypeString, + }, +<% end -%> + "enable_legacy_abac": { Type: schema.TypeBool, Optional: true, @@ -841,6 +848,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro <% unless version == 'ga' -%> d.Set("enable_binary_authorization", cluster.BinaryAuthorization != nil && cluster.BinaryAuthorization.Enabled) d.Set("enable_tpu", cluster.EnableTpu) + d.Set("tpu_ipv4_cidr_block", cluster.TpuIpv4CidrBlock) if err := d.Set("cluster_autoscaling", flattenClusterAutoscaling(cluster.Autoscaling)); err != nil { return err } From 77db03b83e17432fba8723a42deaa48c269f85c9 Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Mon, 10 Dec 2018 15:49:21 -0800 Subject: [PATCH 2/3] adding tpu cidr block output to api.yaml --- products/container/api.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/products/container/api.yaml b/products/container/api.yaml index de2926b672cf..5daab3e206b8 100644 --- a/products/container/api.yaml +++ b/products/container/api.yaml @@ -162,6 +162,13 @@ objects: The IP address range of the container pods in this cluster, in CIDR notation (e.g. 10.96.0.0/14). Leave blank to have one automatically chosen or specify a /14 block in 10.0.0.0/8. + - !ruby/object:Api::Type::String + name: 'tpuIpv4CidrBlock' + output: true + description: | + The IP address range of the Cloud TPUs in this cluster, in + [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + notation (e.g. `1.2.3.4/29`). - !ruby/object:Api::Type::NestedObject name: 'addonsConfig' description: | From 2e03d64cee01556c2bfc67587778bed4701a331c Mon Sep 17 00:00:00 2001 From: Chris Stephens Date: Tue, 11 Dec 2018 10:17:45 -0800 Subject: [PATCH 3/3] Move computed resource location and add docs --- .../resources/resource_container_cluster.go.erb | 14 +++++++------- .../website/docs/r/container_cluster.html.markdown | 4 ++++ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/third_party/terraform/resources/resource_container_cluster.go.erb b/third_party/terraform/resources/resource_container_cluster.go.erb index 6522a992ff73..1db176c53779 100644 --- a/third_party/terraform/resources/resource_container_cluster.go.erb +++ b/third_party/terraform/resources/resource_container_cluster.go.erb @@ -271,13 +271,6 @@ func resourceContainerCluster() *schema.Resource { <% end -%> }, -<% unless version == 'ga' -%> - "tpu_ipv4_cidr_block": { - Computed: true, - Type: schema.TypeString, - }, -<% end -%> - "enable_legacy_abac": { Type: schema.TypeBool, Optional: true, @@ -619,6 +612,13 @@ func resourceContainerCluster() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + +<% unless version == 'ga' -%> + "tpu_ipv4_cidr_block": { + Computed: true, + Type: schema.TypeString, + }, +<% end -%> }, } } 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 07bd79efc32a..ed9cc1093ebc 100644 --- a/third_party/terraform/website/docs/r/container_cluster.html.markdown +++ b/third_party/terraform/website/docs/r/container_cluster.html.markdown @@ -461,6 +461,10 @@ exported: be different than the `min_master_version` set in the config if the master has been updated by GKE. +* `tpu_ipv4_cidr_block` - The IP address range of the Cloud TPUs in this cluster, in + [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + notation (e.g. `1.2.3.4/29`). + ## Timeouts