mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-16 23:29:21 +00:00
Add Delete method to endpoints client.
This commit is contained in:
parent
f6238fa61f
commit
8a17ea4894
@ -35,6 +35,7 @@ type EndpointsInterface interface {
|
|||||||
Create(endpoints *api.Endpoints) (*api.Endpoints, error)
|
Create(endpoints *api.Endpoints) (*api.Endpoints, error)
|
||||||
List(selector labels.Selector) (*api.EndpointsList, error)
|
List(selector labels.Selector) (*api.EndpointsList, error)
|
||||||
Get(name string) (*api.Endpoints, error)
|
Get(name string) (*api.Endpoints, error)
|
||||||
|
Delete(name string) error
|
||||||
Update(endpoints *api.Endpoints) (*api.Endpoints, error)
|
Update(endpoints *api.Endpoints) (*api.Endpoints, error)
|
||||||
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, 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
|
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.
|
// 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) {
|
func (c *endpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||||
return c.r.Get().
|
return c.r.Get().
|
||||||
|
@ -45,6 +45,11 @@ func (c *FakeEndpoints) Get(name string) (*api.Endpoints, error) {
|
|||||||
return obj.(*api.Endpoints), err
|
return obj.(*api.Endpoints), err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *FakeEndpoints) Delete(name string) error {
|
||||||
|
_, err := c.Fake.Invokes(FakeAction{Action: "delete-endpoints", Value: name}, &api.Endpoints{})
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
func (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
func (c *FakeEndpoints) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
|
||||||
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "watch-endpoints", Value: resourceVersion})
|
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "watch-endpoints", Value: resourceVersion})
|
||||||
return c.Fake.Watch, c.Fake.Err
|
return c.Fake.Watch, c.Fake.Err
|
||||||
|
Loading…
Reference in New Issue
Block a user