add status subresource for deployment

This commit is contained in:
Mike Danese
2015-10-16 18:01:08 -07:00
parent 0884214fe0
commit 8acf01d620
8 changed files with 121 additions and 6 deletions

View File

@@ -34,8 +34,9 @@ type DeploymentInterface interface {
List(label labels.Selector, field fields.Selector) (*extensions.DeploymentList, error)
Get(name string) (*extensions.Deployment, error)
Delete(name string, options *api.DeleteOptions) error
Create(Deployment *extensions.Deployment) (*extensions.Deployment, error)
Update(Deployment *extensions.Deployment) (*extensions.Deployment, error)
Create(*extensions.Deployment) (*extensions.Deployment, error)
Update(*extensions.Deployment) (*extensions.Deployment, error)
UpdateStatus(*extensions.Deployment) (*extensions.Deployment, error)
Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error)
}
@@ -93,6 +94,12 @@ func (c *deployments) Update(deployment *extensions.Deployment) (result *extensi
return
}
func (c *deployments) UpdateStatus(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
result = &extensions.Deployment{}
err = c.client.Put().Namespace(c.ns).Resource("deployments").Name(deployment.Name).SubResource("status").Body(deployment).Do().Into(result)
return
}
// Watch returns a watch.Interface that watches the requested deployments.
func (c *deployments) Watch(label labels.Selector, field fields.Selector, opts api.ListOptions) (watch.Interface, error) {
return c.client.Get().