client-go/testing: Straighten out fake implementation of Evictions

Make Evictions the same between Policyv1beta1 and Corev1

Kubernetes-commit: 869adf8bd7e9ec7d8bba8317cb987d760d83833d
This commit is contained in:
Bouke van der Bijl
2018-11-30 15:14:04 +01:00
committed by Kubernetes Publisher
parent 8145e5e321
commit e2d85a5079
2 changed files with 5 additions and 3 deletions

View File

@@ -60,6 +60,7 @@ func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Requ
func (c *FakePods) Evict(eviction *policy.Eviction) error {
action := core.CreateActionImpl{}
action.Verb = "create"
action.Namespace = c.ns
action.Resource = podsResource
action.Subresource = "eviction"
action.Object = eviction

View File

@@ -23,12 +23,13 @@ import (
)
func (c *FakeEvictions) Evict(eviction *policy.Eviction) error {
action := core.GetActionImpl{}
action.Verb = "post"
action := core.CreateActionImpl{}
action.Verb = "create"
action.Namespace = c.ns
action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
action.Subresource = "eviction"
action.Name = eviction.Name
action.Object = eviction
_, err := c.Fake.Invokes(action, eviction)
return err
}