mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Adding GetEndpoints method to the client EndpointsInterface
This commit is contained in:
parent
d65f8e3b90
commit
7c662ff065
@ -78,6 +78,7 @@ type ServiceInterface interface {
|
|||||||
// EndpointsInterface has methods to work with Endpoints resources
|
// EndpointsInterface has methods to work with Endpoints resources
|
||||||
type EndpointsInterface interface {
|
type EndpointsInterface interface {
|
||||||
ListEndpoints(selector labels.Selector) (*api.EndpointsList, error)
|
ListEndpoints(selector labels.Selector) (*api.EndpointsList, error)
|
||||||
|
GetEndpoints(id string) (*api.Endpoints, error)
|
||||||
WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error)
|
WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -429,6 +430,13 @@ func (c *Client) ListEndpoints(selector labels.Selector) (result *api.EndpointsL
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetEndpoints returns information about the endpoints for a particular service.
|
||||||
|
func (c *Client) GetEndpoints(id string) (result *api.Endpoints, err error) {
|
||||||
|
result = &api.Endpoints{}
|
||||||
|
err = c.Get().Path("endpoints").Path(id).Do().Into(result)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// WatchEndpoints returns a watch.Interface that watches the requested endpoints for a service.
|
// WatchEndpoints returns a watch.Interface that watches the requested endpoints for a service.
|
||||||
func (c *Client) WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
|
func (c *Client) WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
|
||||||
return c.Get().
|
return c.Get().
|
||||||
|
@ -132,6 +132,11 @@ func (c *Fake) ListEndpoints(selector labels.Selector) (*api.EndpointsList, erro
|
|||||||
return api.Scheme.CopyOrDie(&c.EndpointsList).(*api.EndpointsList), c.Err
|
return api.Scheme.CopyOrDie(&c.EndpointsList).(*api.EndpointsList), c.Err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *Fake) GetEndpoints(name string) (*api.Endpoints, error) {
|
||||||
|
c.Actions = append(c.Actions, FakeAction{Action: "get-endpoints"})
|
||||||
|
return &api.Endpoints{}, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Fake) WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
|
func (c *Fake) WatchEndpoints(label, field labels.Selector, resourceVersion uint64) (watch.Interface, error) {
|
||||||
c.Actions = append(c.Actions, FakeAction{Action: "watch-endpoints", Value: resourceVersion})
|
c.Actions = append(c.Actions, FakeAction{Action: "watch-endpoints", Value: resourceVersion})
|
||||||
return c.Watch, c.Err
|
return c.Watch, c.Err
|
||||||
|
Loading…
Reference in New Issue
Block a user