cleanup: Refactor BaseEndpointInfo to cache IP and Port values

This commit is contained in:
Junhao Zou
2023-10-28 00:09:44 +08:00
parent 9363edf07b
commit 7a91051caa
6 changed files with 265 additions and 252 deletions

View File

@@ -1066,9 +1066,9 @@ func (proxier *Proxier) syncProxyRules() {
continue
}
epIP := ep.IP()
epPort, err := ep.Port()
epPort := ep.Port()
// Error parsing this endpoint has been logged. Skip to next endpoint.
if epIP == "" || err != nil {
if epIP == "" || epPort == 0 {
continue
}
entry := &utilipset.Entry{