mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	Change stickyMaxAge from seconds to minutes, fixes issue #35677
This commit is contained in:
		| @@ -137,7 +137,7 @@ type serviceInfo struct { | |||||||
| 	nodePort                 int | 	nodePort                 int | ||||||
| 	loadBalancerStatus       api.LoadBalancerStatus | 	loadBalancerStatus       api.LoadBalancerStatus | ||||||
| 	sessionAffinityType      api.ServiceAffinity | 	sessionAffinityType      api.ServiceAffinity | ||||||
| 	stickyMaxAgeSeconds      int | 	stickyMaxAgeMinutes      int | ||||||
| 	externalIPs              []string | 	externalIPs              []string | ||||||
| 	loadBalancerSourceRanges []string | 	loadBalancerSourceRanges []string | ||||||
| 	onlyNodeLocalEndpoints   bool | 	onlyNodeLocalEndpoints   bool | ||||||
| @@ -154,7 +154,7 @@ type endpointsInfo struct { | |||||||
| func newServiceInfo(service proxy.ServicePortName) *serviceInfo { | func newServiceInfo(service proxy.ServicePortName) *serviceInfo { | ||||||
| 	return &serviceInfo{ | 	return &serviceInfo{ | ||||||
| 		sessionAffinityType: api.ServiceAffinityNone, // default | 		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), | 					"-A", string(svcChain), | ||||||
| 					"-m", "comment", "--comment", svcName.String(), | 					"-m", "comment", "--comment", svcName.String(), | ||||||
| 					"-m", "recent", "--name", string(endpointChain), | 					"-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)) | 					"-j", string(endpointChain)) | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|   | |||||||
| @@ -260,7 +260,7 @@ func TestExecConntrackTool(t *testing.T) { | |||||||
| func newFakeServiceInfo(service proxy.ServicePortName, ip net.IP, protocol api.Protocol, onlyNodeLocalEndpoints bool) *serviceInfo { | func newFakeServiceInfo(service proxy.ServicePortName, ip net.IP, protocol api.Protocol, onlyNodeLocalEndpoints bool) *serviceInfo { | ||||||
| 	return &serviceInfo{ | 	return &serviceInfo{ | ||||||
| 		sessionAffinityType:    api.ServiceAffinityNone, // default | 		sessionAffinityType:    api.ServiceAffinityNone, // default | ||||||
| 		stickyMaxAgeSeconds:    180,                     // TODO: paramaterize this in the API. | 		stickyMaxAgeMinutes:    180,                     // TODO: paramaterize this in the API. | ||||||
| 		clusterIP:              ip, | 		clusterIP:              ip, | ||||||
| 		protocol:               protocol, | 		protocol:               protocol, | ||||||
| 		onlyNodeLocalEndpoints: onlyNodeLocalEndpoints, | 		onlyNodeLocalEndpoints: onlyNodeLocalEndpoints, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Vincent Heet
					Vincent Heet