d2iq-archive / mesos-dns

DNS-based service discovery for Mesos.
https://mesosphere.github.com/mesos-dns
Apache License 2.0
483 stars 137 forks source link

*taskID*.slave.mesos can be an invalid A record. #509

Open drewkerrigan opened 7 years ago

drewkerrigan commented 7 years ago

When lookup fails in generator.go's slaveRecords for slave.PID.Host, we default to using labels.DomainFrag(slave.PID.Host, labels.Sep, spec) for the rg.SlaveIPs[slave.ID] value.

Later in taskContextRecord, we use that for *taskID*.slave.mesos records. A test case for this and possibly a fix should be created so that invalid A records are not created in this situation.

My suspicion is that a failure would occur later on down the line because resolver.go will attempt a .To4() on all A records which should fail this case.