Merge pull request #1105 from lavalamp/proxy

Add a generic proxier
This commit is contained in:
brendandburns
2014-09-08 12:51:24 -07:00
8 changed files with 425 additions and 4 deletions

View File

@@ -180,7 +180,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 {

View File

@@ -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 {