Skip to content

Commit

Permalink
fix based on suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
Aris van Ommeren committed Apr 11, 2020
1 parent 4bdbd26 commit bd4384e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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{
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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(),
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion website/docs/d/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/kubernetes_cluster.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit bd4384e

Please sign in to comment.