Merge pull request #4720 from teresy/redundant-nil-check-slice

Remove redundant nil check
This commit is contained in:
Simon Pasquier 2018-10-11 10:24:55 +02:00 committed by GitHub
commit 3e6b9d43c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 {