Azure: Fix panic when IP Address isn't set (#10280)

This commit is contained in:
Levi Harrison 2022-02-10 18:31:18 -05:00 committed by GitHub
parent 4e08110891
commit 1b3443ede1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -361,7 +361,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
if *networkInterface.Primary {
for _, ip := range *networkInterface.IPConfigurations {
if ip.PublicIPAddress != nil && ip.PublicIPAddress.PublicIPAddressPropertiesFormat != nil {
if ip.PublicIPAddress != nil && ip.PublicIPAddress.IPAddress != nil {
labels[azureLabelMachinePublicIP] = model.LabelValue(*ip.PublicIPAddress.IPAddress)
}
if ip.PrivateIPAddress != nil {