mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-07 12:11:43 +00:00
Update references from Path() to the appropriate segment use
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user