Skip to content

Commit

Permalink
Handle bad enum values returned from the GKE API for stack_type (Go…
Browse files Browse the repository at this point in the history
  • Loading branch information
rileykarson authored and ericayyliu committed Jul 26, 2023
1 parent 9edcb03 commit 5b8ac5c
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5152,6 +5152,13 @@ func flattenIPAllocationPolicy(c *container.Cluster, d *schema.ResourceData, con

p := c.IpAllocationPolicy

// handle older clusters that return JSON null
// corresponding to "STACK_TYPE_UNSPECIFIED" due to GKE declining to backfill
// equivalent to default_if_empty
if p.StackType == "" {
p.StackType = "IPV4"
}

return []map[string]interface{}{
{
"cluster_ipv4_cidr_block": p.ClusterIpv4CidrBlock,
Expand Down

0 comments on commit 5b8ac5c

Please sign in to comment.