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:
Daniel Smith
2014-08-27 16:10:44 -07:00
parent e4cd06d2b9
commit e2b645ec15
8 changed files with 334 additions and 4 deletions

View File

@@ -73,8 +73,9 @@ type SimpleRESTStorage struct {
requestedFieldSelector labels.Selector
requestedResourceVersion uint64
// The location
// The id requested, and location to return for ResourceLocation
requestedResourceLocationID string
resourceLocation string
// If non-nil, called inside the WorkFunc when answering update, delete, create.
// obj receives the original input to the update, delete, or create call.
@@ -153,7 +154,7 @@ func (storage *SimpleRESTStorage) ResourceLocation(id string) (string, error) {
if err := storage.errors["resourceLocation"]; err != nil {
return "", err
}
return id, nil
return storage.resourceLocation, nil
}
func extractBody(response *http.Response, object interface{}) (string, error) {