Add replication controller status subresource

This commit is contained in:
derekwaynecarr
2015-09-28 15:39:57 -04:00
parent 43f9280a5d
commit 544b453e31
14 changed files with 265 additions and 29 deletions

View File

@@ -34,6 +34,7 @@ type ReplicationControllerInterface interface {
Get(name string) (*api.ReplicationController, error)
Create(ctrl *api.ReplicationController) (*api.ReplicationController, error)
Update(ctrl *api.ReplicationController) (*api.ReplicationController, error)
UpdateStatus(ctrl *api.ReplicationController) (*api.ReplicationController, error)
Delete(name string) error
Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error)
}
@@ -77,6 +78,13 @@ func (c *replicationControllers) Update(controller *api.ReplicationController) (
return
}
// UpdateStatus updates an existing replication controller status
func (c *replicationControllers) UpdateStatus(controller *api.ReplicationController) (result *api.ReplicationController, err error) {
result = &api.ReplicationController{}
err = c.r.Put().Namespace(c.ns).Resource("replicationControllers").Name(controller.Name).SubResource("status").Body(controller).Do().Into(result)
return
}
// Delete deletes an existing replication controller.
func (c *replicationControllers) Delete(name string) error {
return c.r.Delete().Namespace(c.ns).Resource("replicationControllers").Name(name).Do().Error()