mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
Remove a mostly-unused variable in the ipvs proxy
It probably was used for something else in the past but it's pointless now.
This commit is contained in:
parent
3a65b989e3
commit
f7bb9a9a0a
@ -1004,22 +1004,15 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Both nodeAddresses and nodeIPs can be reused for all nodePort services
|
// List of node IP addresses to be used as IPVS services if nodePort is set. This
|
||||||
// and only need to be computed if we have at least one nodePort service.
|
// can be reused for all nodePort services.
|
||||||
var (
|
var nodeIPs []net.IP
|
||||||
// List of node addresses to listen on if a nodePort is set.
|
|
||||||
nodeAddresses []string
|
|
||||||
// List of node IP addresses to be used as IPVS services if nodePort is set.
|
|
||||||
nodeIPs []net.IP
|
|
||||||
)
|
|
||||||
|
|
||||||
if hasNodePort {
|
if hasNodePort {
|
||||||
nodeAddrSet, err := proxier.nodePortAddresses.GetNodeAddresses(proxier.networkInterfacer)
|
nodeAddrSet, err := proxier.nodePortAddresses.GetNodeAddresses(proxier.networkInterfacer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.ErrorS(err, "Failed to get node IP address matching nodeport cidr")
|
klog.ErrorS(err, "Failed to get node IP address matching nodeport cidr")
|
||||||
} else {
|
} else {
|
||||||
nodeAddresses = nodeAddrSet.UnsortedList()
|
for _, address := range nodeAddrSet.UnsortedList() {
|
||||||
for _, address := range nodeAddresses {
|
|
||||||
a := netutils.ParseIPSloppy(address)
|
a := netutils.ParseIPSloppy(address)
|
||||||
if a.IsLoopback() {
|
if a.IsLoopback() {
|
||||||
continue
|
continue
|
||||||
@ -1292,7 +1285,7 @@ func (proxier *Proxier) syncProxyRules() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if svcInfo.NodePort() != 0 {
|
if svcInfo.NodePort() != 0 {
|
||||||
if len(nodeAddresses) == 0 || len(nodeIPs) == 0 {
|
if len(nodeIPs) == 0 {
|
||||||
// Skip nodePort configuration since an error occurred when
|
// Skip nodePort configuration since an error occurred when
|
||||||
// computing nodeAddresses or nodeIPs.
|
// computing nodeAddresses or nodeIPs.
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user