Skip to content

Commit 18464d4

Browse files
authored
Merge pull request kubernetes#71599 from bouk/fake-eviction
client-go/testing: Straighten out fake implementation of Evictions
2 parents 7d85546 + 869adf8 commit 18464d4

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

pkg/client/clientset_generated/internalclientset/typed/policy/internalversion/fake/fake_eviction_expansion.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ import (
2323
)
2424

2525
func (c *FakeEvictions) Evict(eviction *policy.Eviction) error {
26-
action := core.GetActionImpl{}
27-
action.Verb = "post"
26+
action := core.CreateActionImpl{}
27+
action.Verb = "create"
2828
action.Namespace = c.ns
2929
action.Resource = schema.GroupVersionResource{Group: "", Version: "", Resource: "pods"}
3030
action.Subresource = "eviction"
31+
action.Object = eviction
32+
3133
_, err := c.Fake.Invokes(action, eviction)
3234
return err
3335
}

staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod_expansion.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Requ
6060
func (c *FakePods) Evict(eviction *policy.Eviction) error {
6161
action := core.CreateActionImpl{}
6262
action.Verb = "create"
63+
action.Namespace = c.ns
6364
action.Resource = podsResource
6465
action.Subresource = "eviction"
6566
action.Object = eviction

staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@ import (
2323
)
2424

2525
func (c *FakeEvictions) Evict(eviction *policy.Eviction) error {
26-
action := core.GetActionImpl{}
27-
action.Verb = "post"
26+
action := core.CreateActionImpl{}
27+
action.Verb = "create"
2828
action.Namespace = c.ns
2929
action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"}
3030
action.Subresource = "eviction"
31-
action.Name = eviction.Name
31+
action.Object = eviction
32+
3233
_, err := c.Fake.Invokes(action, eviction)
3334
return err
3435
}

0 commit comments

Comments
 (0)