Update references from Path() to the appropriate segment use

This commit is contained in:
Clayton Coleman
2014-12-26 15:06:25 -05:00
parent afedbba3fc
commit e355f54eda
20 changed files with 258 additions and 111 deletions

View File

@@ -53,14 +53,14 @@ func newEndpoints(c *Client, namespace string) *endpoints {
// Create creates a new endpoint.
func (c *endpoints) Create(endpoints *api.Endpoints) (*api.Endpoints, error) {
result := &api.Endpoints{}
err := c.r.Post().Namespace(c.ns).Path("endpoints").Body(endpoints).Do().Into(result)
err := c.r.Post().Namespace(c.ns).Resource("endpoints").Body(endpoints).Do().Into(result)
return result, err
}
// List takes a selector, and returns the list of endpoints that match that selector
func (c *endpoints) List(selector labels.Selector) (result *api.EndpointsList, err error) {
result = &api.EndpointsList{}
err = c.r.Get().Namespace(c.ns).Path("endpoints").SelectorParam("labels", selector).Do().Into(result)
err = c.r.Get().Namespace(c.ns).Resource("endpoints").SelectorParam("labels", selector).Do().Into(result)
return
}
@@ -71,16 +71,16 @@ func (c *endpoints) Get(name string) (result *api.Endpoints, err error) {
}
result = &api.Endpoints{}
err = c.r.Get().Namespace(c.ns).Path("endpoints").Path(name).Do().Into(result)
err = c.r.Get().Namespace(c.ns).Resource("endpoints").Name(name).Do().Into(result)
return
}
// Watch returns a watch.Interface that watches the requested endpoints for a service.
func (c *endpoints) Watch(label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
return c.r.Get().
Path("watch").
Prefix("watch").
Namespace(c.ns).
Path("endpoints").
Resource("endpoints").
Param("resourceVersion", resourceVersion).
SelectorParam("labels", label).
SelectorParam("fields", field).
@@ -94,8 +94,8 @@ func (c *endpoints) Update(endpoints *api.Endpoints) (*api.Endpoints, error) {
}
err := c.r.Put().
Namespace(c.ns).
Path("endpoints").
Path(endpoints.Name).
Resource("endpoints").
Name(endpoints.Name).
Body(endpoints).
Do().
Into(result)