mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Add a generic proxier
To proxy traffic to anything that implements ResourceLocation. Currently, this is only services. This is easily extensible to minions (would supercede existing mechanism) and pods.
This commit is contained in:
@@ -179,7 +179,7 @@ func (rs *RegistryStorage) ResourceLocation(id string) (string, error) {
|
||||
if len(e.Endpoints) == 0 {
|
||||
return "", fmt.Errorf("no endpoints available for %v", id)
|
||||
}
|
||||
return e.Endpoints[rand.Intn(len(e.Endpoints))], nil
|
||||
return "http://" + e.Endpoints[rand.Intn(len(e.Endpoints))], nil
|
||||
}
|
||||
|
||||
func (rs *RegistryStorage) deleteExternalLoadBalancer(service *api.Service) error {
|
||||
|
@@ -291,7 +291,7 @@ func TestServiceRegistryResourceLocation(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("Unexpected error: %v", err)
|
||||
}
|
||||
if e, a := "foo:80", location; e != a {
|
||||
if e, a := "http://foo:80", location; e != a {
|
||||
t.Errorf("Expected %v, but got %v", e, a)
|
||||
}
|
||||
if e, a := "foo", registry.GottenID; e != a {
|
||||
|
Reference in New Issue
Block a user