Plumb the conntrack.Interface up to the proxiers
And use the fake interface in the unit tests, removing the dependency on setting up FakeExec stuff when conntrack cleanup will be invoked. Also, remove the isIPv6 argument to CleanStaleEntries, because it can be inferred from the other args.
This commit is contained in:
@@ -170,7 +170,7 @@ type Proxier struct {
|
||||
iptables utiliptables.Interface
|
||||
masqueradeAll bool
|
||||
masqueradeMark string
|
||||
exec utilexec.Interface
|
||||
conntrack conntrack.Interface
|
||||
localDetector proxyutiliptables.LocalTrafficDetector
|
||||
hostname string
|
||||
nodeIP net.IP
|
||||
@@ -283,7 +283,7 @@ func NewProxier(ipFamily v1.IPFamily,
|
||||
iptables: ipt,
|
||||
masqueradeAll: masqueradeAll,
|
||||
masqueradeMark: masqueradeMark,
|
||||
exec: exec,
|
||||
conntrack: conntrack.NewExec(exec),
|
||||
localDetector: localDetector,
|
||||
hostname: hostname,
|
||||
nodeIP: nodeIP,
|
||||
@@ -1538,7 +1538,7 @@ func (proxier *Proxier) syncProxyRules() {
|
||||
}
|
||||
|
||||
// Finish housekeeping, clear stale conntrack entries for UDP Services
|
||||
conntrack.CleanStaleEntries(proxier.iptables.IsIPv6(), proxier.exec, proxier.svcPortMap, serviceUpdateResult, endpointUpdateResult)
|
||||
conntrack.CleanStaleEntries(proxier.conntrack, proxier.svcPortMap, serviceUpdateResult, endpointUpdateResult)
|
||||
}
|
||||
|
||||
func (proxier *Proxier) writeServiceToEndpointRules(natRules proxyutil.LineBuffer, svcPortNameString string, svcInfo proxy.ServicePort, svcChain utiliptables.Chain, endpoints []proxy.Endpoint, args []string) {
|
||||
|
Reference in New Issue
Block a user