Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/kubernetes_cluster: Only setting the VnetSubnetID when it's != "" #1158

Merged
merged 1 commit into from
Apr 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions azurerm/resource_arm_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,20 +441,23 @@ func expandAzureRmKubernetesClusterAgentProfiles(d *schema.ResourceData) []conta
dnsPrefix := config["dns_prefix"].(string)
vmSize := config["vm_size"].(string)
osDiskSizeGB := int32(config["os_disk_size_gb"].(int))
vnetSubnetID := config["vnet_subnet_id"].(string)
osType := config["os_type"].(string)

profile := containerservice.AgentPoolProfile{
Name: &name,
Count: &count,
Name: utils.String(name),
Count: utils.Int32(count),
VMSize: containerservice.VMSizeTypes(vmSize),
DNSPrefix: &dnsPrefix,
OsDiskSizeGB: &osDiskSizeGB,
DNSPrefix: utils.String(dnsPrefix),
OsDiskSizeGB: utils.Int32(osDiskSizeGB),
StorageProfile: containerservice.ManagedDisks,
VnetSubnetID: &vnetSubnetID,
OsType: containerservice.OSType(osType),
}

vnetSubnetID := config["vnet_subnet_id"].(string)
if vnetSubnetID != "" {
profile.VnetSubnetID = utils.String(vnetSubnetID)
}

profiles = append(profiles, profile)

return profiles
Expand Down