From 528bc97dd3fa01a25ba6d7393fa341645c85d5bc Mon Sep 17 00:00:00 2001 From: Vincent Heet Date: Thu, 27 Oct 2016 09:56:17 +0200 Subject: [PATCH] Change stickyMaxAge from seconds to minutes, fixes issue #35677 --- pkg/proxy/iptables/proxier.go | 6 +++--- pkg/proxy/iptables/proxier_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/proxy/iptables/proxier.go b/pkg/proxy/iptables/proxier.go index 4f08a302b8732..ca51bb4ce9bd6 100644 --- a/pkg/proxy/iptables/proxier.go +++ b/pkg/proxy/iptables/proxier.go @@ -137,7 +137,7 @@ type serviceInfo struct { nodePort int loadBalancerStatus api.LoadBalancerStatus sessionAffinityType api.ServiceAffinity - stickyMaxAgeSeconds int + stickyMaxAgeMinutes int externalIPs []string loadBalancerSourceRanges []string onlyNodeLocalEndpoints bool @@ -154,7 +154,7 @@ type endpointsInfo struct { func newServiceInfo(service proxy.ServicePortName) *serviceInfo { return &serviceInfo{ sessionAffinityType: api.ServiceAffinityNone, // default - stickyMaxAgeSeconds: 180, // TODO: paramaterize this in the API. + stickyMaxAgeMinutes: 180, // TODO: paramaterize this in the API. } } @@ -1140,7 +1140,7 @@ func (proxier *Proxier) syncProxyRules() { "-A", string(svcChain), "-m", "comment", "--comment", svcName.String(), "-m", "recent", "--name", string(endpointChain), - "--rcheck", "--seconds", fmt.Sprintf("%d", svcInfo.stickyMaxAgeSeconds), "--reap", + "--rcheck", "--seconds", fmt.Sprintf("%d", svcInfo.stickyMaxAgeMinutes*60), "--reap", "-j", string(endpointChain)) } } diff --git a/pkg/proxy/iptables/proxier_test.go b/pkg/proxy/iptables/proxier_test.go index ad0a028f10e50..1784d7b4e024b 100644 --- a/pkg/proxy/iptables/proxier_test.go +++ b/pkg/proxy/iptables/proxier_test.go @@ -260,7 +260,7 @@ func TestExecConntrackTool(t *testing.T) { func newFakeServiceInfo(service proxy.ServicePortName, ip net.IP, protocol api.Protocol, onlyNodeLocalEndpoints bool) *serviceInfo { return &serviceInfo{ sessionAffinityType: api.ServiceAffinityNone, // default - stickyMaxAgeSeconds: 180, // TODO: paramaterize this in the API. + stickyMaxAgeMinutes: 180, // TODO: paramaterize this in the API. clusterIP: ip, protocol: protocol, onlyNodeLocalEndpoints: onlyNodeLocalEndpoints,