mirror of
https://github.com/prometheus/prometheus
synced 2024-12-27 17:13:22 +00:00
Merge pull request #4720 from teresy/redundant-nil-check-slice
Remove redundant nil check
This commit is contained in:
commit
3e6b9d43c3
@ -244,11 +244,9 @@ func (d *Discovery) refresh() (tg *targetgroup.Group, err error) {
|
||||
}
|
||||
|
||||
// GCE labels are key-value pairs that group associated resources
|
||||
if inst.Labels != nil {
|
||||
for key, value := range inst.Labels {
|
||||
name := strutil.SanitizeLabelName(key)
|
||||
labels[gceLabelLabel+model.LabelName(name)] = model.LabelValue(value)
|
||||
}
|
||||
for key, value := range inst.Labels {
|
||||
name := strutil.SanitizeLabelName(key)
|
||||
labels[gceLabelLabel+model.LabelName(name)] = model.LabelValue(value)
|
||||
}
|
||||
|
||||
if len(priIface.AccessConfigs) > 0 {
|
||||
|
Loading…
Reference in New Issue
Block a user