Implement redirection & proxying for minions

This commit is contained in:
Daniel Smith
2014-10-17 14:21:53 -07:00
parent 82bbcee8d9
commit f748e2d2c5
3 changed files with 24 additions and 4 deletions

View File

@@ -245,7 +245,9 @@ func (rs *REST) ResourceLocation(ctx api.Context, id string) (string, error) {
if len(e.Endpoints) == 0 {
return "", fmt.Errorf("no endpoints available for %v", id)
}
return "http://" + e.Endpoints[rand.Intn(len(e.Endpoints))], nil
// We leave off the scheme ('http://') because we have no idea what sort of server
// is listening at this endpoint.
return e.Endpoints[rand.Intn(len(e.Endpoints))], nil
}
func (rs *REST) deleteExternalLoadBalancer(service *api.Service) error {