From bd4384e7f9908f1d2b8be54cda583ef003746978 Mon Sep 17 00:00:00 2001 From: Aris van Ommeren Date: Sat, 11 Apr 2020 13:47:45 +0200 Subject: [PATCH] fix based on suggestion --- .../containers/data_source_kubernetes_cluster.go | 8 ++++---- .../containers/resource_arm_kubernetes_cluster.go | 12 ++++++------ .../tests/data_source_kubernetes_cluster_test.go | 2 +- .../resource_arm_kubernetes_cluster_network_test.go | 6 +++--- website/docs/d/kubernetes_cluster.html.markdown | 2 +- website/docs/r/kubernetes_cluster.html.markdown | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/azurerm/internal/services/containers/data_source_kubernetes_cluster.go b/azurerm/internal/services/containers/data_source_kubernetes_cluster.go index df0d72b6ca896..813b803235731 100644 --- a/azurerm/internal/services/containers/data_source_kubernetes_cluster.go +++ b/azurerm/internal/services/containers/data_source_kubernetes_cluster.go @@ -215,11 +215,11 @@ func dataSourceArmKubernetesCluster() *schema.Resource { Type: schema.TypeBool, Computed: true, Optional: true, - ConflictsWith: []string{"enable_private_cluster"}, - Deprecated: "Deprecated in favor of `enable_private_cluster`", // TODO -- remove this in next major version + ConflictsWith: []string{"private_cluster_enabled"}, + Deprecated: "Deprecated in favor of `private_cluster_enabled`", // TODO -- remove this in next major version }, - "enable_private_cluster": { + "private_cluster_enabled": { Type: schema.TypeBool, Optional: true, Computed: true, // TODO -- remove this when deprecation resolves @@ -503,7 +503,7 @@ func dataSourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{} } d.Set("private_link_enabled", accessProfile.EnablePrivateCluster) - d.Set("enable_private_cluster", accessProfile.EnablePrivateCluster) + d.Set("private_cluster_enabled", accessProfile.EnablePrivateCluster) } addonProfiles := flattenKubernetesClusterDataSourceAddonProfiles(props.AddonProfiles) diff --git a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go b/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go index fe76df29c3faa..4989d04188fcc 100644 --- a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go +++ b/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go @@ -302,11 +302,11 @@ func resourceArmKubernetesCluster() *schema.Resource { Optional: true, ForceNew: true, Computed: true, - ConflictsWith: []string{"enable_private_cluster"}, - Deprecated: "Deprecated in favor of `enable_private_cluster`", // TODO -- remove this in next major version + ConflictsWith: []string{"private_cluster_enabled"}, + Deprecated: "Deprecated in favor of `private_cluster_enabled`", // TODO -- remove this in next major version }, - "enable_private_cluster": { + "private_cluster_enabled": { Type: schema.TypeBool, Optional: true, ForceNew: true, @@ -574,7 +574,7 @@ func resourceArmKubernetesClusterCreate(d *schema.ResourceData, meta interface{} if v, ok := d.GetOk("private_link_enabled"); ok { enablePrivateCluster = v.(bool) } - if v, ok := d.GetOk("enable_private_cluster"); ok { + if v, ok := d.GetOk("private_cluster_enabled"); ok { enablePrivateCluster = v.(bool) } @@ -765,7 +765,7 @@ func resourceArmKubernetesClusterUpdate(d *schema.ResourceData, meta interface{} if v, ok := d.GetOk("private_link_enabled"); ok { enablePrivateCluster = v.(bool) } - if v, ok := d.GetOk("enable_private_cluster"); ok { + if v, ok := d.GetOk("private_cluster_enabled"); ok { enablePrivateCluster = v.(bool) } existing.ManagedClusterProperties.APIServerAccessProfile = &containerservice.ManagedClusterAPIServerAccessProfile{ @@ -930,7 +930,7 @@ func resourceArmKubernetesClusterRead(d *schema.ResourceData, meta interface{}) } d.Set("private_link_enabled", accessProfile.EnablePrivateCluster) - d.Set("enable_private_cluster", accessProfile.EnablePrivateCluster) + d.Set("private_cluster_enabled", accessProfile.EnablePrivateCluster) } addonProfiles := flattenKubernetesAddOnProfiles(props.AddonProfiles) diff --git a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go index 7078d6c9fce83..8a2e20e8093f4 100644 --- a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go +++ b/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go @@ -60,7 +60,7 @@ func testAccDataSourceAzureRMKubernetesCluster_privateCluster(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMKubernetesClusterExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "private_fqdn"), - resource.TestCheckResourceAttr(data.ResourceName, "enable_private_cluster", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "private_cluster_enabled", "true"), ), }, data.ImportStep("service_principal.0.client_secret"), diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_network_test.go b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_network_test.go index d58f59369229b..49687744eb312 100644 --- a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_network_test.go +++ b/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_network_test.go @@ -348,7 +348,7 @@ func testAccAzureRMKubernetesCluster_privateClusterOn(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMKubernetesClusterExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "private_fqdn"), - resource.TestCheckResourceAttr(data.ResourceName, "enable_private_cluster", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "private_cluster_enabled", "true"), ), }, data.ImportStep(), @@ -373,7 +373,7 @@ func testAccAzureRMKubernetesCluster_privateClusterOff(t *testing.T) { Config: testAccAzureRMKubernetesCluster_privateClusterConfig(data, false), Check: resource.ComposeTestCheckFunc( testCheckAzureRMKubernetesClusterExists(data.ResourceName), - resource.TestCheckResourceAttr(data.ResourceName, "enable_private_cluster", "false"), + resource.TestCheckResourceAttr(data.ResourceName, "private_cluster_enabled", "false"), ), }, data.ImportStep(), @@ -1030,7 +1030,7 @@ resource "azurerm_kubernetes_cluster" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name dns_prefix = "acctestaks%d" - enable_private_cluster = %t + private_cluster_enabled = %t linux_profile { admin_username = "acctestuser%d" diff --git a/website/docs/d/kubernetes_cluster.html.markdown b/website/docs/d/kubernetes_cluster.html.markdown index 234f2b1bf541c..807fa1969d77f 100644 --- a/website/docs/d/kubernetes_cluster.html.markdown +++ b/website/docs/d/kubernetes_cluster.html.markdown @@ -62,7 +62,7 @@ The following attributes are exported: * `kubernetes_version` - The version of Kubernetes used on the managed Kubernetes Cluster. -* `enable_private_cluster` - If the cluster has the Kubernetes API only exposed on internal IP addresses. +* `private_cluster_enabled` - If the cluster has the Kubernetes API only exposed on internal IP addresses. * `location` - The Azure Region in which the managed Kubernetes Cluster exists. diff --git a/website/docs/r/kubernetes_cluster.html.markdown b/website/docs/r/kubernetes_cluster.html.markdown index a72e226fcca43..83d79a103c7bb 100644 --- a/website/docs/r/kubernetes_cluster.html.markdown +++ b/website/docs/r/kubernetes_cluster.html.markdown @@ -100,7 +100,7 @@ In addition, one of either `identity` or `service_principal` must be specified. -> **NOTE:** Azure requires that a new, non-existent Resource Group is used, as otherwise the provisioning of the Kubernetes Service will fail. -* `enable_private_cluster` Should this Kubernetes Cluster have it's API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to `false`. Changing this forces a new resource to be created. +* `private_cluster_enabled` Should this Kubernetes Cluster have it's API server only exposed on internal IP addresses? This provides a Private IP Address for the Kubernetes API on the Virtual Network where the Kubernetes Cluster is located. Defaults to `false`. Changing this forces a new resource to be created. * `role_based_access_control` - (Optional) A `role_based_access_control` block. Changing this forces a new resource to be created.