Skip to content

Commit

Permalink
Escape health probe when health probe is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcturusZhang authored and tombuildsstuff committed Feb 3, 2020
1 parent 7917fa3 commit 7e34d78
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -613,13 +613,15 @@ func resourceArmLinuxVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta i
return fmt.Errorf("Error expanding `network_interface`: %+v", err)
}

healthProbeId := d.Get("health_probe_id").(string)

updateProps.VirtualMachineProfile.NetworkProfile = &compute.VirtualMachineScaleSetUpdateNetworkProfile{
NetworkInterfaceConfigurations: networkInterfaces,
HealthProbe: &compute.APIEntityReference{
}

healthProbeId := d.Get("health_probe_id").(string)
if healthProbeId != "" {
updateProps.VirtualMachineProfile.NetworkProfile.HealthProbe = &compute.APIEntityReference{
ID: utils.String(healthProbeId),
},
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,13 +700,15 @@ func resourceArmWindowsVirtualMachineScaleSetUpdate(d *schema.ResourceData, meta
return fmt.Errorf("Error expanding `network_interface`: %+v", err)
}

healthProbeId := d.Get("health_probe_id").(string)

updateProps.VirtualMachineProfile.NetworkProfile = &compute.VirtualMachineScaleSetUpdateNetworkProfile{
NetworkInterfaceConfigurations: networkInterfaces,
HealthProbe: &compute.APIEntityReference{
}

healthProbeId := d.Get("health_probe_id").(string)
if healthProbeId != "" {
updateProps.VirtualMachineProfile.NetworkProfile.HealthProbe = &compute.APIEntityReference{
ID: utils.String(healthProbeId),
},
}
}
}

Expand Down

0 comments on commit 7e34d78

Please sign in to comment.