Merge pull request #8337 from prometheus/beorn7/sd

prevent adding empty target when CNAME is encountered
This commit is contained in:
Björn Rabenstein 2021-01-04 17:52:04 +01:00 committed by GitHub
commit de4fbed840
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,6 +213,7 @@ func (d *Discovery) refreshOne(ctx context.Context, name string, ch chan<- *targ
target = hostPort(addr.AAAA.String(), d.port)
case *dns.CNAME:
// CNAME responses can occur with "Type: A" dns_sd_config requests.
continue
default:
level.Warn(d.logger).Log("msg", "Invalid record", "record", record)
continue