mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 05:04:05 -08:00
Azure: Fix panic when IP Address isn't set (#10280)
This commit is contained in:
parent
4e08110891
commit
1b3443ede1
|
@ -361,7 +361,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
|
|
||||||
if *networkInterface.Primary {
|
if *networkInterface.Primary {
|
||||||
for _, ip := range *networkInterface.IPConfigurations {
|
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)
|
labels[azureLabelMachinePublicIP] = model.LabelValue(*ip.PublicIPAddress.IPAddress)
|
||||||
}
|
}
|
||||||
if ip.PrivateIPAddress != nil {
|
if ip.PrivateIPAddress != nil {
|
||||||
|
|
Loading…
Reference in a new issue