Merge pull request #128833 from my-git9/deadcode-proxytil

proxy/util: remove unused function
This commit is contained in:
Kubernetes Prow Robot 2024-12-12 04:12:39 +00:00 committed by GitHub
commit 9c892ce3a3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 20 deletions

View File

@ -41,11 +41,6 @@ const (
IPv6ZeroCIDR = "::/0"
)
// isValidEndpoint checks that the given host / port pair are valid endpoint
func isValidEndpoint(host string, port int) bool {
return host != "" && port > 0
}
// IsZeroCIDR checks whether the input CIDR string is either
// the IPv4 or IPv6 zero CIDR
func IsZeroCIDR(cidr string) bool {

View File

@ -27,21 +27,6 @@ import (
netutils "k8s.io/utils/net"
)
func TestValidateWorks(t *testing.T) {
if isValidEndpoint("", 0) {
t.Errorf("Didn't fail for empty set")
}
if isValidEndpoint("foobar", 0) {
t.Errorf("Didn't fail with invalid port")
}
if isValidEndpoint("foobar", -1) {
t.Errorf("Didn't fail with a negative port")
}
if !isValidEndpoint("foobar", 8080) {
t.Errorf("Failed a valid config.")
}
}
func TestShouldSkipService(t *testing.T) {
testCases := []struct {
service *v1.Service