Added NewUpdateSubresourceAction to testclient actions
This commit is contained in:
@@ -100,6 +100,17 @@ func NewUpdateAction(resource, namespace string, object runtime.Object) UpdateAc
|
|||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewUpdateSubresourceAction(resource, subresource, namespace string, object runtime.Object) UpdateActionImpl {
|
||||||
|
action := UpdateActionImpl{}
|
||||||
|
action.Verb = "update"
|
||||||
|
action.Resource = resource
|
||||||
|
action.Subresource = subresource
|
||||||
|
action.Namespace = namespace
|
||||||
|
action.Object = object
|
||||||
|
|
||||||
|
return action
|
||||||
|
}
|
||||||
|
|
||||||
func NewRootDeleteAction(resource, name string) DeleteActionImpl {
|
func NewRootDeleteAction(resource, name string) DeleteActionImpl {
|
||||||
action := DeleteActionImpl{}
|
action := DeleteActionImpl{}
|
||||||
action.Verb = "delete"
|
action.Verb = "delete"
|
||||||
|
@@ -74,13 +74,7 @@ func (c *FakePersistentVolumeClaims) Watch(label labels.Selector, field fields.S
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakePersistentVolumeClaims) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
|
func (c *FakePersistentVolumeClaims) UpdateStatus(claim *api.PersistentVolumeClaim) (*api.PersistentVolumeClaim, error) {
|
||||||
action := UpdateActionImpl{}
|
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("persistentvolumeclaims", "status", c.Namespace, claim), claim)
|
||||||
action.Verb = "update"
|
|
||||||
action.Resource = "persistentvolumeclaims"
|
|
||||||
action.Subresource = "status"
|
|
||||||
action.Object = claim
|
|
||||||
|
|
||||||
obj, err := c.Fake.Invokes(action, claim)
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@@ -92,13 +92,7 @@ func (c *FakePods) Bind(binding *api.Binding) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakePods) UpdateStatus(pod *api.Pod) (*api.Pod, error) {
|
func (c *FakePods) UpdateStatus(pod *api.Pod) (*api.Pod, error) {
|
||||||
action := UpdateActionImpl{}
|
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("pods", "status", c.Namespace, pod), pod)
|
||||||
action.Verb = "update"
|
|
||||||
action.Resource = "pods"
|
|
||||||
action.Subresource = "status"
|
|
||||||
action.Object = pod
|
|
||||||
|
|
||||||
obj, err := c.Fake.Invokes(action, pod)
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@@ -76,13 +76,7 @@ func (c *FakeResourceQuotas) Watch(label labels.Selector, field fields.Selector,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
|
func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *api.ResourceQuota) (*api.ResourceQuota, error) {
|
||||||
action := UpdateActionImpl{}
|
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("resourcequotas", "status", c.Namespace, resourceQuota), resourceQuota)
|
||||||
action.Verb = "update"
|
|
||||||
action.Resource = "resourcequotas"
|
|
||||||
action.Subresource = "status"
|
|
||||||
action.Object = resourceQuota
|
|
||||||
|
|
||||||
obj, err := c.Fake.Invokes(action, resourceQuota)
|
|
||||||
if obj == nil {
|
if obj == nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user