Skip to content

Commit

Permalink
Handle bad enum values returned from the GKE API for stack_type (#7627
Browse files Browse the repository at this point in the history
)
  • Loading branch information
rileykarson authored Apr 4, 2023
1 parent 61cb3dd commit 18d31e0
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 18d31e0

Please sign in to comment.