mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Added NewUpdateSubresourceAction to testclient actions
This commit is contained in:
parent
4b5c2253f3
commit
bdec7da47b
@ -100,6 +100,17 @@ func NewUpdateAction(resource, namespace string, object runtime.Object) UpdateAc
|
||||
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 {
|
||||
action := DeleteActionImpl{}
|
||||
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) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "persistentvolumeclaims"
|
||||
action.Subresource = "status"
|
||||
action.Object = claim
|
||||
|
||||
obj, err := c.Fake.Invokes(action, claim)
|
||||
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("persistentvolumeclaims", "status", c.Namespace, claim), claim)
|
||||
if obj == nil {
|
||||
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) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "pods"
|
||||
action.Subresource = "status"
|
||||
action.Object = pod
|
||||
|
||||
obj, err := c.Fake.Invokes(action, pod)
|
||||
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("pods", "status", c.Namespace, pod), pod)
|
||||
if obj == nil {
|
||||
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) {
|
||||
action := UpdateActionImpl{}
|
||||
action.Verb = "update"
|
||||
action.Resource = "resourcequotas"
|
||||
action.Subresource = "status"
|
||||
action.Object = resourceQuota
|
||||
|
||||
obj, err := c.Fake.Invokes(action, resourceQuota)
|
||||
obj, err := c.Fake.Invokes(NewUpdateSubresourceAction("resourcequotas", "status", c.Namespace, resourceQuota), resourceQuota)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user