CNAME responses can occur with "Type: A" dns_sd_config requests (#8216)

Signed-off-by: Matt Berther <mattberther@users.noreply.github.com>
pull/8244/head
Matt Berther 4 years ago committed by GitHub
parent a6e18916ab
commit acee998df6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -211,8 +211,10 @@ func (d *Discovery) refreshOne(ctx context.Context, name string, ch chan<- *targ
target = hostPort(addr.A.String(), d.port) target = hostPort(addr.A.String(), d.port)
case *dns.AAAA: case *dns.AAAA:
target = hostPort(addr.AAAA.String(), d.port) target = hostPort(addr.AAAA.String(), d.port)
case *dns.CNAME:
// CNAME responses can occur with "Type: A" dns_sd_config requests.
default: default:
level.Warn(d.logger).Log("msg", "Invalid SRV record", "record", record) level.Warn(d.logger).Log("msg", "Invalid record", "record", record)
continue continue
} }
tg.Targets = append(tg.Targets, model.LabelSet{ tg.Targets = append(tg.Targets, model.LabelSet{

Loading…
Cancel
Save