-
Notifications
You must be signed in to change notification settings - Fork 38.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kube-proxy]: Remove unused util functions #124929
[kube-proxy]: Remove unused util functions #124929
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/cc @aojea @danwinship |
6c1e2ee
to
facf702
Compare
/test pull-kubernetes-unit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, looks like this is all dead code.
/lgtm
/approve
(nitpick if you do any similar PRs in the future: I'd call them "unused" functions, not "useless")
@@ -46,19 +45,3 @@ func IPPart(s string) string { | |||
} | |||
return ip.String() | |||
} | |||
|
|||
// PortPart returns just the port part of an endpoint string. | |||
func PortPart(s string) (int, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused after updating BaseEndpointInfo
to store the IP and port separately in #120104
@@ -49,25 +46,6 @@ func isValidEndpoint(host string, port int) bool { | |||
return host != "" && port > 0 | |||
} | |||
|
|||
// BuildPortsToEndpointsMap builds a map of portname -> all ip:ports for that | |||
// portname. Explode Endpoints.Subsets[*] into this structure. | |||
func BuildPortsToEndpointsMap(endpoints *v1.Endpoints) map[string][]string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused after the removal of the userspace proxy in #112133
@@ -77,51 +55,6 @@ func IsZeroCIDR(cidr string) bool { | |||
return false | |||
} | |||
|
|||
// IsLoopBack checks if a given IP address is a loopback address. | |||
func IsLoopBack(ip string) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused after NodePortAddress rewrites in #116016
} | ||
|
||
// GetLocalAddrs returns a list of all network addresses on the local system | ||
func GetLocalAddrs() ([]net.IP, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only used by GetLocalAddrSet
|
||
// GetLocalAddrSet return a local IPSet. | ||
// If failed to get local addr, will assume no local ips. | ||
func GetLocalAddrSet() netutils.IPSet { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused after removal of the "port opener" code in #108496
@@ -261,20 +194,6 @@ func AppendPortIfNeeded(addr string, port int32) string { | |||
return fmt.Sprintf("[%s]:%d", addr, port) | |||
} | |||
|
|||
// ShuffleStrings copies strings from the specified slice into a copy in random | |||
// order. It returns a new slice. | |||
func ShuffleStrings(s []string) []string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused after the removal of the userspace proxy in #112133
@@ -313,18 +232,6 @@ func GetClusterIPByFamily(ipFamily v1.IPFamily, service *v1.Service) string { | |||
return "" | |||
} | |||
|
|||
// RevertPorts is closing ports in replacementPortsMap but not in originalPortsMap. In other words, it only | |||
// closes the ports opened in this sync. | |||
func RevertPorts(replacementPortsMap, originalPortsMap map[netutils.LocalPort]netutils.Closeable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused after removal of the "port opener" code in #108496
LGTM label has been added. Git tree hash: 1be1b16eb273c7e5ca44d1033a93dba1a6e5ed57
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, HirazawaUi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
All right and thank you very much for tracing to when these codes are not used |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
They are no longer used.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Just saw the useless function while reading the code, feel free to close this PR if I'm doing something wrong.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: