Browse Source

Guard against tags being nil in EC2 discovery

Fixes #3001
pull/3405/head
Dominik Schulz 7 years ago
parent
commit
a731a43302
  1. 3
      discovery/ec2/ec2.go

3
discovery/ec2/ec2.go

@ -200,6 +200,9 @@ func (d *Discovery) refresh() (tg *config.TargetGroup, err error) {
}
for _, t := range inst.Tags {
if t == nil || t.Key == nil || t.Value == nil {
continue
}
name := strutil.SanitizeLabelName(*t.Key)
labels[ec2LabelTag+model.LabelName(name)] = model.LabelValue(*t.Value)
}

Loading…
Cancel
Save