diff options
Diffstat (limited to 'plugin/backend_lookup.go')
-rw-r--r-- | plugin/backend_lookup.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/plugin/backend_lookup.go b/plugin/backend_lookup.go index 002d1855b..65cdcbaf5 100644 --- a/plugin/backend_lookup.go +++ b/plugin/backend_lookup.go @@ -172,6 +172,11 @@ func SRV(b ServiceBackend, zone string, state request.Request, opt Options) (rec w[serv.Priority] += weight } for _, serv := range services { + // Don't add the entry if the port is -1 (invalid). The kubernetes plugin uses port -1 when a service/endpoint + // does not have any declared ports. + if serv.Port == -1 { + continue + } w1 := 100.0 / float64(w[serv.Priority]) if serv.Weight == 0 { w1 *= 100 |