Add Delete method to endpoints client.

This commit is contained in:
Daniel Smith
2015-04-16 16:25:04 -07:00
parent f6238fa61f
commit 8a17ea4894
2 changed files with 11 additions and 0 deletions

View File

@@ -35,6 +35,7 @@ type EndpointsInterface interface {
Create(endpoints *api.Endpoints) (*api.Endpoints, error)
List(selector labels.Selector) (*api.EndpointsList, error)
Get(name string) (*api.Endpoints, error)
Delete(name string) error
Update(endpoints *api.Endpoints) (*api.Endpoints, error)
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
}
@@ -76,6 +77,11 @@ func (c *endpoints) Get(name string) (result *api.Endpoints, err error) {
return
}
// Delete takes the name of the endpoint, and returns an error if one occurs
func (c *endpoints) Delete(name string) error {
return c.r.Delete().Namespace(c.ns).Resource("endpoints").Name(name).Do().Error()
}
// Watch returns a watch.Interface that watches the requested endpoints for a service.
func (c *endpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
return c.r.Get().