mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Search for port number for service locator
This commit is contained in:
@@ -491,6 +491,18 @@ func TestServiceRegistryResourceLocation(t *testing.T) {
|
||||
t.Errorf("Expected %v, but got %v", e, a)
|
||||
}
|
||||
|
||||
// Test a name + port number.
|
||||
location, _, err = redirector.ResourceLocation(ctx, "foo:93")
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %v", err)
|
||||
}
|
||||
if location == nil {
|
||||
t.Errorf("Unexpected nil: %v", location)
|
||||
}
|
||||
if e, a := "//1.2.3.4:93", location.String(); e != a {
|
||||
t.Errorf("Expected %v, but got %v", e, a)
|
||||
}
|
||||
|
||||
// Test a scheme + name + port.
|
||||
location, _, err = redirector.ResourceLocation(ctx, "https:foo:p")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user