Skip to content

Commit

Permalink
Add top-level services_ipv4_cidr attr to container_cluster. (#3776)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored and paddycarver committed Jun 3, 2019
1 parent b6caf8c commit 2628282
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions google/resource_container_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,11 @@ func resourceContainerCluster() *schema.Resource {
Computed: true,
},

"services_ipv4_cidr": {
Type: schema.TypeString,
Computed: true,
},

"ip_allocation_policy": {
Type: schema.TypeList,
MaxItems: 1,
Expand Down Expand Up @@ -902,6 +907,7 @@ func resourceContainerClusterRead(d *schema.ResourceData, meta interface{}) erro
d.Set("master_version", cluster.CurrentMasterVersion)
d.Set("node_version", cluster.CurrentNodeVersion)
d.Set("cluster_ipv4_cidr", cluster.ClusterIpv4Cidr)
d.Set("services_ipv4_cidr", cluster.ServicesIpv4Cidr)
d.Set("description", cluster.Description)
d.Set("enable_kubernetes_alpha", cluster.EnableKubernetesAlpha)
d.Set("enable_legacy_abac", cluster.LegacyAbac.Enabled)
Expand Down
3 changes: 3 additions & 0 deletions google/resource_container_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ func TestAccContainerCluster_basic(t *testing.T) {
Steps: []resource.TestStep{
{
Config: testAccContainerCluster_basic(clusterName),
Check: resource.ComposeAggregateTestCheckFunc(
resource.TestCheckResourceAttrSet("google_container_cluster.primary", "services_ipv4_cidr"),
),
},
{
ResourceName: "google_container_cluster.primary",
Expand Down
5 changes: 5 additions & 0 deletions website/docs/r/container_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,11 @@ exported:
[CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
notation (e.g. `1.2.3.4/29`).

* `services_ipv4_cidr` - The IP address range of the Kubernetes services in this
cluster, in [CIDR](http:en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
notation (e.g. `1.2.3.4/29`). Service addresses are typically put in the last
`/16` from the container CIDR.

<a id="timeouts"></a>
## Timeouts

Expand Down

0 comments on commit 2628282

Please sign in to comment.