mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
Merge pull request #96251 from ravens/nodeport_udp_conntrack_fix
Correctly fix clearing conntrack entry on endpoint changes (nodeport)
This commit is contained in:
commit
48a2bca893
@ -768,9 +768,11 @@ func (proxier *Proxier) deleteEndpointConnections(connectionMap []proxy.ServiceE
|
|||||||
var err error
|
var err error
|
||||||
if nodePort != 0 {
|
if nodePort != 0 {
|
||||||
err = conntrack.ClearEntriesForPortNAT(proxier.exec, endpointIP, nodePort, svcProto)
|
err = conntrack.ClearEntriesForPortNAT(proxier.exec, endpointIP, nodePort, svcProto)
|
||||||
} else {
|
if err != nil {
|
||||||
err = conntrack.ClearEntriesForNAT(proxier.exec, svcInfo.ClusterIP().String(), endpointIP, svcProto)
|
klog.Errorf("Failed to delete nodeport-related %s endpoint connections, error: %v", epSvcPair.ServicePortName.String(), err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
err = conntrack.ClearEntriesForNAT(proxier.exec, svcInfo.ClusterIP().String(), endpointIP, svcProto)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("Failed to delete %s endpoint connections, error: %v", epSvcPair.ServicePortName.String(), err)
|
klog.Errorf("Failed to delete %s endpoint connections, error: %v", epSvcPair.ServicePortName.String(), err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user