plugin/kubernetes: Create records for portless services (#2052)
inject sentinels for portless services
This commit is contained in:
parent
75f1b9c988
commit
d60993e021
3 changed files with 64 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue