mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-11 13:57:36 -08:00
[BUGFIX] Azure SD: Fix 'error: parameter virtualMachineScaleSetName cannot be empty' (#13702)
Erroneous code was introduced during a merge-back-to-main at #13399. Signed-off-by: michaelact <86778470+michaelact@users.noreply.github.com>
This commit is contained in:
parent
e8bf2ce4e1
commit
eea6ab1cdd
|
@ -413,26 +413,20 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
} else {
|
} else {
|
||||||
networkInterface, err = client.getVMScaleSetVMNetworkInterfaceByID(ctx, nicID, vm.ScaleSet, vm.InstanceID)
|
networkInterface, err = client.getVMScaleSetVMNetworkInterfaceByID(ctx, nicID, vm.ScaleSet, vm.InstanceID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, errorNotFound) {
|
if errors.Is(err, errorNotFound) {
|
||||||
level.Warn(d.logger).Log("msg", "Network interface does not exist", "name", nicID, "err", err)
|
level.Warn(d.logger).Log("msg", "Network interface does not exist", "name", nicID, "err", err)
|
||||||
} else {
|
} else {
|
||||||
ch <- target{labelSet: nil, err: err}
|
ch <- target{labelSet: nil, err: err}
|
||||||
}
|
}
|
||||||
d.addToCache(nicID, networkInterface)
|
|
||||||
} else {
|
// Get out of this routine because we cannot continue without a network interface.
|
||||||
networkInterface, err = client.getVMScaleSetVMNetworkInterfaceByID(ctx, nicID, vm.ScaleSet, vm.InstanceID)
|
return
|
||||||
if err != nil {
|
|
||||||
if errors.Is(err, errorNotFound) {
|
|
||||||
level.Warn(d.logger).Log("msg", "Network interface does not exist", "name", nicID, "err", err)
|
|
||||||
} else {
|
|
||||||
ch <- target{labelSet: nil, err: err}
|
|
||||||
}
|
|
||||||
// Get out of this routine because we cannot continue without a network interface.
|
|
||||||
return
|
|
||||||
}
|
|
||||||
d.addToCache(nicID, networkInterface)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Continue processing with the network interface
|
||||||
|
d.addToCache(nicID, networkInterface)
|
||||||
}
|
}
|
||||||
|
|
||||||
if networkInterface.Properties == nil {
|
if networkInterface.Properties == nil {
|
||||||
|
|
Loading…
Reference in a new issue