Skip to content

Commit

Permalink
Suppress private_endpoint_subnetwork when master_ipv4_cidr_block is set
Browse files Browse the repository at this point in the history
  • Loading branch information
Francis-Liu committed Mar 4, 2024
1 parent ae819d0 commit 4de9c66
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ func ResourceContainerCluster() *schema.Resource {
Optional: true,
ForceNew: true,
AtLeastOneOf: privateClusterConfigKeys,
DiffSuppressFunc: tpgresource.CompareSelfLinkOrResourceName,
DiffSuppressFunc: containerClusterPrivateClusterConfigSuppress,
Description: `Subnetwork in cluster's network where master's endpoint will be provisioned.`,
},
"public_endpoint": {
Expand Down Expand Up @@ -6387,6 +6387,10 @@ func containerClusterPrivateClusterConfigSuppress(k, old, new string, d *schema.
return suppressNodes && !hasSubnet
} else if k == "private_cluster_config.#" {
return suppressEndpoint && suppressNodes && !hasSubnet && !hasGlobalAccessConfig
} else if k == "private_cluster_config.0.private_endpoint_subnetwork" {
// Suppress diffs in private_endpoint_subnetwork when master_ipv4_cidr_block is set
_, hasMasterCidr := d.GetOk("private_cluster_config.0.master_ipv4_cidr_block")
return hasMasterCidr || tpgresource.CompareSelfLinkOrResourceName(k, old, new, d)
}
return false
}
Expand Down

0 comments on commit 4de9c66

Please sign in to comment.