Skip to content

Commit 528bc97

Browse files
committed
Change stickyMaxAge from seconds to minutes, fixes issue kubernetes#35677
1 parent 1b62e4c commit 528bc97

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pkg/proxy/iptables/proxier.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ type serviceInfo struct {
137137
nodePort int
138138
loadBalancerStatus api.LoadBalancerStatus
139139
sessionAffinityType api.ServiceAffinity
140-
stickyMaxAgeSeconds int
140+
stickyMaxAgeMinutes int
141141
externalIPs []string
142142
loadBalancerSourceRanges []string
143143
onlyNodeLocalEndpoints bool
@@ -154,7 +154,7 @@ type endpointsInfo struct {
154154
func newServiceInfo(service proxy.ServicePortName) *serviceInfo {
155155
return &serviceInfo{
156156
sessionAffinityType: api.ServiceAffinityNone, // default
157-
stickyMaxAgeSeconds: 180, // TODO: paramaterize this in the API.
157+
stickyMaxAgeMinutes: 180, // TODO: paramaterize this in the API.
158158
}
159159
}
160160

@@ -1140,7 +1140,7 @@ func (proxier *Proxier) syncProxyRules() {
11401140
"-A", string(svcChain),
11411141
"-m", "comment", "--comment", svcName.String(),
11421142
"-m", "recent", "--name", string(endpointChain),
1143-
"--rcheck", "--seconds", fmt.Sprintf("%d", svcInfo.stickyMaxAgeSeconds), "--reap",
1143+
"--rcheck", "--seconds", fmt.Sprintf("%d", svcInfo.stickyMaxAgeMinutes*60), "--reap",
11441144
"-j", string(endpointChain))
11451145
}
11461146
}

pkg/proxy/iptables/proxier_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ func TestExecConntrackTool(t *testing.T) {
260260
func newFakeServiceInfo(service proxy.ServicePortName, ip net.IP, protocol api.Protocol, onlyNodeLocalEndpoints bool) *serviceInfo {
261261
return &serviceInfo{
262262
sessionAffinityType: api.ServiceAffinityNone, // default
263-
stickyMaxAgeSeconds: 180, // TODO: paramaterize this in the API.
263+
stickyMaxAgeMinutes: 180, // TODO: paramaterize this in the API.
264264
clusterIP: ip,
265265
protocol: protocol,
266266
onlyNodeLocalEndpoints: onlyNodeLocalEndpoints,

0 commit comments

Comments
 (0)