Skip to content

Commit

Permalink
azurerm_kubernetes_cluster - nil check publicNetworkAccess (#19048)
Browse files Browse the repository at this point in the history
* nil check publicNetworkAccess

* assign correct value to variable
  • Loading branch information
stephybun committed Oct 28, 2022
1 parent 7544123 commit 8083460
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/services/containers/kubernetes_cluster_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1882,7 +1882,12 @@ func resourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{})
d.Set("node_resource_group", props.NodeResourceGroup)
d.Set("enable_pod_security_policy", props.EnablePodSecurityPolicy)
d.Set("local_account_disabled", props.DisableLocalAccounts)
d.Set("public_network_access_enabled", *props.PublicNetworkAccess != managedclusters.PublicNetworkAccessDisabled)

publicNetworkAccess := managedclusters.PublicNetworkAccessEnabled
if props.PublicNetworkAccess != nil {
publicNetworkAccess = *props.PublicNetworkAccess
}
d.Set("public_network_access_enabled", publicNetworkAccess != managedclusters.PublicNetworkAccessDisabled)

upgradeChannel := ""
if profile := props.AutoUpgradeProfile; profile != nil && *profile.UpgradeChannel != managedclusters.UpgradeChannelNone {
Expand Down

0 comments on commit 8083460

Please sign in to comment.