Skip to content

Commit

Permalink
As per review: fixed indentation. Type casted to string whereever nec…
Browse files Browse the repository at this point in the history
…essary. Removed check for calico in CustomizeDiff block.

Signed-off-by: thatInfrastructureGuy <[email protected]>
  • Loading branch information
thatInfrastructureGuy committed Mar 4, 2019
1 parent c75a19f commit 6801100
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion azurerm/data_source_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ func flattenKubernetesClusterDataSourceNetworkProfile(profile *containerservice.
values["network_plugin"] = profile.NetworkPlugin

if profile.NetworkPolicy != "" {
values["network_policy"] = profile.NetworkPolicy
values["network_policy"] = string(profile.NetworkPolicy)
}

if profile.ServiceCidr != nil {
Expand Down
8 changes: 1 addition & 7 deletions azurerm/resource_arm_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ func resourceArmKubernetesCluster() *schema.Resource {
return nil
}

networkPolicy := profile["network_policy"].(string)

if networkPolicy != "calico" {
return nil
}

dockerBridgeCidr := profile["docker_bridge_cidr"].(string)
dnsServiceIP := profile["dns_service_ip"].(string)
serviceCidr := profile["service_cidr"].(string)
Expand Down Expand Up @@ -1069,7 +1063,7 @@ func flattenKubernetesClusterNetworkProfile(profile *containerservice.NetworkPro
values["network_plugin"] = profile.NetworkPlugin

if profile.NetworkPolicy != "" {
values["network_policy"] = profile.NetworkPolicy
values["network_policy"] = string(profile.NetworkPolicy)
}

if profile.ServiceCidr != nil {
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_kubernetes_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ resource "azurerm_kubernetes_cluster" "test" {
network_profile {
network_plugin = "%s"
network_policy = "%s"
network_policy = "%s"
}
}
`, rInt, location, rInt, rInt, rInt, rInt, rInt, clientId, clientSecret, networkPlugin, networkPolicy)
Expand Down Expand Up @@ -1301,8 +1301,8 @@ resource "azurerm_kubernetes_cluster" "test" {
}
network_profile {
network_plugin = "%s"
network_policy = "%s"
network_plugin = "%s"
network_policy = "%s"
dns_service_ip = "10.10.0.10"
docker_bridge_cidr = "172.18.0.1/16"
service_cidr = "10.10.0.0/16"
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 @@ -146,7 +146,7 @@ A `network_profile` block supports the following:

-> **NOTE:** When `network_plugin` is set to `azure` - the `vnet_subnet_id` field in the `agent_pool_profile` block must be set.

* `network_policy` - (Optional) Sets up network policy to be used with Azure CNI. [Network policy allows us to control the traffic flow between pods](https://docs.microsoft.com/en-us/azure/aks/use-network-policies). This field can only be set when `network_plugin` is set to `azure`. Currently only accepted value is `calico` which installs Calico daemonset. Changing this forces a new resource to be created.
* `network_policy` - (Optional) Sets up network policy to be used with Azure CNI. [Network policy allows us to control the traffic flow between pods](https://docs.microsoft.com/en-us/azure/aks/use-network-policies). This field can only be set when `network_plugin` is set to `azure`. Currently the only accepted value is `calico` which installs Calico daemonset. Changing this forces a new resource to be created.

* `dns_service_ip` - (Optional) IP address within the Kubernetes service address range that will be used by cluster service discovery (kube-dns). This is required when `network_plugin` is set to `azure`. Changing this forces a new resource to be created.

Expand Down

0 comments on commit 6801100

Please sign in to comment.