mirror of
https://github.com/coredns/coredns.git
synced 2025-10-31 18:23:13 -04:00
Fix tests
Add a whole bunch of comments to document what we are trying to do.
This commit is contained in:
@@ -450,13 +450,19 @@ func (k *Kubernetes) findServices(r recordRequest) ([]kService, error) {
|
||||
if ep.ObjectMeta.Name != svc.Name || ep.ObjectMeta.Namespace != svc.Namespace {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, eps := range ep.Subsets {
|
||||
for _, addr := range eps.Addresses {
|
||||
for _, p := range eps.Ports {
|
||||
ephostname := endpointHostname(addr)
|
||||
if r.endpoint != "" && r.endpoint != ephostname {
|
||||
|
||||
// See comments in parse.go parseRequest about the endpoint handling.
|
||||
|
||||
if r.endpoint != "" {
|
||||
if !match(r.endpoint, endpointHostname(addr)) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
for _, p := range eps.Ports {
|
||||
if !(match(r.port, p.Name) && match(r.protocol, string(p.Protocol))) {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user