From 6f34be30a3ee4cf57bdadf262e4949e190163b6f Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 17 Aug 2015 20:54:05 -0700 Subject: [PATCH] Limit float precision to 5 points --- pkg/proxy/iptables/proxier.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index e227492c4ca..d3d800b8d42 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -652,7 +652,7 @@ func (proxier *Proxier) syncProxyRules() error { args = append(args, "-m", "statistic", "--mode", "random", - "--probability", fmt.Sprintf("%f", 1.0/float64(n-i))) + "--probability", fmt.Sprintf("%0.5f", 1.0/float64(n-i))) } // The final (or only if n == 1) rule is a guaranteed match. args = append(args, "-j", string(endpointChain))