2 Copyright 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.
17 // Code generated by client-gen. DO NOT EDIT.
22 v1beta2 "k8s.io/api/apps/v1beta2"
23 v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
24 labels "k8s.io/apimachinery/pkg/labels"
25 schema "k8s.io/apimachinery/pkg/runtime/schema"
26 types "k8s.io/apimachinery/pkg/types"
27 watch "k8s.io/apimachinery/pkg/watch"
28 testing "k8s.io/client-go/testing"
31 // FakeControllerRevisions implements ControllerRevisionInterface
32 type FakeControllerRevisions struct {
37 var controllerrevisionsResource = schema.GroupVersionResource{Group: "apps", Version: "v1beta2", Resource: "controllerrevisions"}
39 var controllerrevisionsKind = schema.GroupVersionKind{Group: "apps", Version: "v1beta2", Kind: "ControllerRevision"}
41 // Get takes name of the controllerRevision, and returns the corresponding controllerRevision object, and an error if there is any.
42 func (c *FakeControllerRevisions) Get(name string, options v1.GetOptions) (result *v1beta2.ControllerRevision, err error) {
44 Invokes(testing.NewGetAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{})
49 return obj.(*v1beta2.ControllerRevision), err
52 // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors.
53 func (c *FakeControllerRevisions) List(opts v1.ListOptions) (result *v1beta2.ControllerRevisionList, err error) {
55 Invokes(testing.NewListAction(controllerrevisionsResource, controllerrevisionsKind, c.ns, opts), &v1beta2.ControllerRevisionList{})
61 label, _, _ := testing.ExtractFromListOptions(opts)
63 label = labels.Everything()
65 list := &v1beta2.ControllerRevisionList{ListMeta: obj.(*v1beta2.ControllerRevisionList).ListMeta}
66 for _, item := range obj.(*v1beta2.ControllerRevisionList).Items {
67 if label.Matches(labels.Set(item.Labels)) {
68 list.Items = append(list.Items, item)
74 // Watch returns a watch.Interface that watches the requested controllerRevisions.
75 func (c *FakeControllerRevisions) Watch(opts v1.ListOptions) (watch.Interface, error) {
77 InvokesWatch(testing.NewWatchAction(controllerrevisionsResource, c.ns, opts))
81 // Create takes the representation of a controllerRevision and creates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
82 func (c *FakeControllerRevisions) Create(controllerRevision *v1beta2.ControllerRevision) (result *v1beta2.ControllerRevision, err error) {
84 Invokes(testing.NewCreateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{})
89 return obj.(*v1beta2.ControllerRevision), err
92 // Update takes the representation of a controllerRevision and updates it. Returns the server's representation of the controllerRevision, and an error, if there is any.
93 func (c *FakeControllerRevisions) Update(controllerRevision *v1beta2.ControllerRevision) (result *v1beta2.ControllerRevision, err error) {
95 Invokes(testing.NewUpdateAction(controllerrevisionsResource, c.ns, controllerRevision), &v1beta2.ControllerRevision{})
100 return obj.(*v1beta2.ControllerRevision), err
103 // Delete takes name of the controllerRevision and deletes it. Returns an error if one occurs.
104 func (c *FakeControllerRevisions) Delete(name string, options *v1.DeleteOptions) error {
106 Invokes(testing.NewDeleteAction(controllerrevisionsResource, c.ns, name), &v1beta2.ControllerRevision{})
111 // DeleteCollection deletes a collection of objects.
112 func (c *FakeControllerRevisions) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
113 action := testing.NewDeleteCollectionAction(controllerrevisionsResource, c.ns, listOptions)
115 _, err := c.Fake.Invokes(action, &v1beta2.ControllerRevisionList{})
119 // Patch applies the patch and returns the patched controllerRevision.
120 func (c *FakeControllerRevisions) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta2.ControllerRevision, err error) {
122 Invokes(testing.NewPatchSubresourceAction(controllerrevisionsResource, c.ns, name, pt, data, subresources...), &v1beta2.ControllerRevision{})
127 return obj.(*v1beta2.ControllerRevision), err