2 Copyright 2014 The Kubernetes Authors.
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
21 policy "k8s.io/api/policy/v1beta1"
22 restclient "k8s.io/client-go/rest"
23 core "k8s.io/client-go/testing"
26 func (c *FakePods) Bind(binding *v1.Binding) error {
27 action := core.CreateActionImpl{}
28 action.Verb = "create"
29 action.Namespace = binding.Namespace
30 action.Resource = podsResource
31 action.Subresource = "binding"
32 action.Object = binding
34 _, err := c.Fake.Invokes(action, binding)
38 func (c *FakePods) GetBinding(name string) (result *v1.Binding, err error) {
40 Invokes(core.NewGetSubresourceAction(podsResource, c.ns, "binding", name), &v1.Binding{})
45 return obj.(*v1.Binding), err
48 func (c *FakePods) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Request {
49 action := core.GenericActionImpl{}
51 action.Namespace = c.ns
52 action.Resource = podsResource
53 action.Subresource = "log"
56 _, _ = c.Fake.Invokes(action, &v1.Pod{})
57 return &restclient.Request{}
60 func (c *FakePods) Evict(eviction *policy.Eviction) error {
61 action := core.CreateActionImpl{}
62 action.Verb = "create"
63 action.Resource = podsResource
64 action.Subresource = "eviction"
65 action.Object = eviction
67 _, err := c.Fake.Invokes(action, eviction)