Skip to content

Commit

Permalink
Kubernetes AdvancedNetworking: Added validation for pod_cidr when net…
Browse files Browse the repository at this point in the history
…work_plugin is set to 'azure'. (#1763)

* Added validation for pod_cidr

* Changed wording of error message
  • Loading branch information
lfshr authored and tombuildsstuff committed Aug 14, 2018
1 parent 8675821 commit 6daf5e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions azurerm/resource_arm_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func resourceArmKubernetesCluster() *schema.Resource {
return nil
}

podCidr := profile["pod_cidr"].(string)

if networkPlugin == "azure" && podCidr != "" {
return fmt.Errorf("The `pod_cidr` field in the `network_profile` block can not be specified when `network_plugin` is set to `azure`. Please remove `pod_cidr` or set `network_plugin` to `kubenet`.")
}

dockerBridgeCidr := profile["docker_bridge_cidr"].(string)
dnsServiceIP := profile["dns_service_ip"].(string)
serviceCidr := profile["service_cidr"].(string)
Expand Down

0 comments on commit 6daf5e2

Please sign in to comment.