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 10, 2020
1 parent 94c31b6 commit 4d9e294
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 @@ -611,13 +611,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 @@ -646,13 +646,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 4d9e294

Please sign in to comment.