aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/xfr.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/kubernetes/xfr.go')
-rw-r--r--plugin/kubernetes/xfr.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugin/kubernetes/xfr.go b/plugin/kubernetes/xfr.go
index 7759c5a47..a3a0d4a4a 100644
--- a/plugin/kubernetes/xfr.go
+++ b/plugin/kubernetes/xfr.go
@@ -228,6 +228,11 @@ func calcSRVWeight(numservices int) uint16 {
}
w[serv.Priority] += weight
}
+ weight := uint16(math.Floor((100.0 / float64(w[0])) * 100))
+ // weight should be at least 1
+ if weight == 0 {
+ weight = 1
+ }
- return uint16(math.Floor((100.0 / float64(w[0])) * 100))
+ return weight
}