Merge pull request #71599 from bouk/fake-eviction

client-go/testing: Straighten out fake implementation of Evictions
pull/564/head
Kubernetes Prow Robot 2018-12-28 14:48:59 -08:00 committed by GitHub
commit 18464d472a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

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

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 { func (c *FakePods) Evict(eviction *policy.Eviction) error {
action := core.CreateActionImpl{} action := core.CreateActionImpl{}
action.Verb = "create" action.Verb = "create"
action.Namespace = c.ns
action.Resource = podsResource action.Resource = podsResource
action.Subresource = "eviction" action.Subresource = "eviction"
action.Object = eviction action.Object = eviction

View File

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