Skip to content

Commit

Permalink
container: bump additive_vpc_scope_dns_domain to GA (GoogleCloudPla…
Browse files Browse the repository at this point in the history
  • Loading branch information
DrFaust92 authored Aug 28, 2024
1 parent fcc529c commit b7538e9
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2126,13 +2126,11 @@ func ResourceContainerCluster() *schema.Resource {
Description: `Configuration for Cloud DNS for Kubernetes Engine.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
{{- if ne $.TargetVersionName "ga" }}
"additive_vpc_scope_dns_domain": {
Type: schema.TypeString,
Description: `Enable additive VPC scope DNS in a GKE cluster.`,
Optional: true,
},
{{- end }}
"cluster_dns": {
Type: schema.TypeString,
Default: "PROVIDER_UNSPECIFIED",
Expand Down Expand Up @@ -5488,9 +5486,7 @@ func expandDnsConfig(configured interface{}) *container.DNSConfig {

config := l[0].(map[string]interface{})
return &container.DNSConfig{
{{- if ne $.TargetVersionName "ga" }}
AdditiveVpcScopeDnsDomain: config["additive_vpc_scope_dns_domain"].(string),
{{- end }}
ClusterDns: config["cluster_dns"].(string),
ClusterDnsScope: config["cluster_dns_scope"].(string),
ClusterDnsDomain: config["cluster_dns_domain"].(string),
Expand Down Expand Up @@ -6402,9 +6398,7 @@ func flattenDnsConfig(c *container.DNSConfig) []map[string]interface{} {
}
return []map[string]interface{}{
{
{{- if ne $.TargetVersionName "ga" }}
"additive_vpc_scope_dns_domain": c.AdditiveVpcScopeDnsDomain,
{{- end }}
"cluster_dns": c.ClusterDns,
"cluster_dns_scope": c.ClusterDnsScope,
"cluster_dns_domain": c.ClusterDnsDomain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,6 @@ func TestAccContainerCluster_withFQDNNetworkPolicy(t *testing.T) {
}
{{- end }}

{{ if ne $.TargetVersionName `ga` -}}
func TestAccContainerCluster_withAdditiveVPC(t *testing.T) {
t.Parallel()

Expand All @@ -511,7 +510,6 @@ func TestAccContainerCluster_withAdditiveVPC(t *testing.T) {
},
})
}
{{- end }}

func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -699,7 +697,6 @@ resource "google_container_cluster" "cluster" {
`, clusterName, clusterName)
}

{{ if ne $.TargetVersionName `ga` -}}
func testAccContainerCluster_withAdditiveVPC(clusterName string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "cluster" {
Expand All @@ -716,7 +713,6 @@ resource "google_container_cluster" "cluster" {
}
`, clusterName)
}
{{- end }}

{{ if ne $.TargetVersionName `ga` -}}
func testAccContainerCluster_withFQDNNetworkPolicy(clusterName string, enabled bool) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2132,13 +2132,11 @@ func ResourceContainerCluster() *schema.Resource {
Description: `Configuration for Cloud DNS for Kubernetes Engine.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
<% unless version == 'ga' -%>
"additive_vpc_scope_dns_domain": {
Type: schema.TypeString,
Description: `Enable additive VPC scope DNS in a GKE cluster.`,
Optional: true,
},
<% end -%>
"cluster_dns": {
Type: schema.TypeString,
Default: "PROVIDER_UNSPECIFIED",
Expand Down Expand Up @@ -5565,9 +5563,7 @@ func expandDnsConfig(configured interface{}) *container.DNSConfig {

config := l[0].(map[string]interface{})
return &container.DNSConfig{
<% unless version == 'ga' -%>
AdditiveVpcScopeDnsDomain: config["additive_vpc_scope_dns_domain"].(string),
<% end -%>
ClusterDns: config["cluster_dns"].(string),
ClusterDnsScope: config["cluster_dns_scope"].(string),
ClusterDnsDomain: config["cluster_dns_domain"].(string),
Expand Down Expand Up @@ -6467,9 +6463,7 @@ func flattenDnsConfig(c *container.DNSConfig) []map[string]interface{} {
}
return []map[string]interface{}{
{
<% unless version == 'ga' -%>
"additive_vpc_scope_dns_domain": c.AdditiveVpcScopeDnsDomain,
<% end -%>
"cluster_dns": c.ClusterDns,
"cluster_dns_scope": c.ClusterDnsScope,
"cluster_dns_domain": c.ClusterDnsDomain,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ func TestAccContainerCluster_withFQDNNetworkPolicy(t *testing.T) {
}
<% end -%>

<% unless version == 'ga' -%>
func TestAccContainerCluster_withAdditiveVPC(t *testing.T) {
t.Parallel()

Expand All @@ -513,7 +512,6 @@ func TestAccContainerCluster_withAdditiveVPC(t *testing.T) {
},
})
}
<% end -%>

func TestAccContainerCluster_withMasterAuthConfig_NoCert(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -701,7 +699,6 @@ resource "google_container_cluster" "cluster" {
`, clusterName, clusterName)
}

<% unless version == 'ga' -%>
func testAccContainerCluster_withAdditiveVPC(clusterName string) string {
return fmt.Sprintf(`
resource "google_container_cluster" "cluster" {
Expand All @@ -718,7 +715,6 @@ resource "google_container_cluster" "cluster" {
}
`, clusterName)
}
<% end -%>

<% unless version == 'ga' -%>
func testAccContainerCluster_withFQDNNetworkPolicy(clusterName string, enabled bool) string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ linux_node_config {

<a name="nested_dns_config"></a>The `dns_config` block supports:

* `additive_vpc_scope_dns_domain` - (Optional, [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html)) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work `cluster_dns = "CLOUD_DNS"` and `cluster_dns_scope = "CLUSTER_SCOPE"` must both be set as well.
* `additive_vpc_scope_dns_domain` - (Optional) This will enable Cloud DNS additive VPC scope. Must provide a domain name that is unique within the VPC. For this to work `cluster_dns = "CLOUD_DNS"` and `cluster_dns_scope = "CLUSTER_SCOPE"` must both be set as well.

* `cluster_dns` - (Optional) Which in-cluster DNS provider should be used. `PROVIDER_UNSPECIFIED` (default) or `PLATFORM_DEFAULT` or `CLOUD_DNS`.

Expand Down

0 comments on commit b7538e9

Please sign in to comment.