mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
cleanup: remove unnacessary nil check before range (#7194)
Signed-off-by: Guangming Wang <guangming.wang@daocloud.io>
This commit is contained in:
parent
f36ae1c21c
commit
5b4006ac86
|
@ -302,12 +302,10 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
labels[azureLabelMachineScaleSet] = model.LabelValue(vm.ScaleSet)
|
labels[azureLabelMachineScaleSet] = model.LabelValue(vm.ScaleSet)
|
||||||
}
|
}
|
||||||
|
|
||||||
if vm.Tags != nil {
|
|
||||||
for k, v := range vm.Tags {
|
for k, v := range vm.Tags {
|
||||||
name := strutil.SanitizeLabelName(k)
|
name := strutil.SanitizeLabelName(k)
|
||||||
labels[azureLabelMachineTag+model.LabelName(name)] = model.LabelValue(*v)
|
labels[azureLabelMachineTag+model.LabelName(name)] = model.LabelValue(*v)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Get the IP address information via separate call to the network provider.
|
// Get the IP address information via separate call to the network provider.
|
||||||
for _, nicID := range vm.NetworkInterfaces {
|
for _, nicID := range vm.NetworkInterfaces {
|
||||||
|
|
Loading…
Reference in a new issue