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 v1beta1 "k8s.io/api/extensions/v1beta1"
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 // FakeReplicaSets implements ReplicaSetInterface
32 type FakeReplicaSets struct {
33 Fake *FakeExtensionsV1beta1
37 var replicasetsResource = schema.GroupVersionResource{Group: "extensions", Version: "v1beta1", Resource: "replicasets"}
39 var replicasetsKind = schema.GroupVersionKind{Group: "extensions", Version: "v1beta1", Kind: "ReplicaSet"}
41 // Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
42 func (c *FakeReplicaSets) Get(name string, options v1.GetOptions) (result *v1beta1.ReplicaSet, err error) {
44 Invokes(testing.NewGetAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{})
49 return obj.(*v1beta1.ReplicaSet), err
52 // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
53 func (c *FakeReplicaSets) List(opts v1.ListOptions) (result *v1beta1.ReplicaSetList, err error) {
55 Invokes(testing.NewListAction(replicasetsResource, replicasetsKind, c.ns, opts), &v1beta1.ReplicaSetList{})
61 label, _, _ := testing.ExtractFromListOptions(opts)
63 label = labels.Everything()
65 list := &v1beta1.ReplicaSetList{ListMeta: obj.(*v1beta1.ReplicaSetList).ListMeta}
66 for _, item := range obj.(*v1beta1.ReplicaSetList).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 replicaSets.
75 func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
77 InvokesWatch(testing.NewWatchAction(replicasetsResource, c.ns, opts))
81 // Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
82 func (c *FakeReplicaSets) Create(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
84 Invokes(testing.NewCreateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{})
89 return obj.(*v1beta1.ReplicaSet), err
92 // Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
93 func (c *FakeReplicaSets) Update(replicaSet *v1beta1.ReplicaSet) (result *v1beta1.ReplicaSet, err error) {
95 Invokes(testing.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &v1beta1.ReplicaSet{})
100 return obj.(*v1beta1.ReplicaSet), err
103 // UpdateStatus was generated because the type contains a Status member.
104 // Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
105 func (c *FakeReplicaSets) UpdateStatus(replicaSet *v1beta1.ReplicaSet) (*v1beta1.ReplicaSet, error) {
107 Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &v1beta1.ReplicaSet{})
112 return obj.(*v1beta1.ReplicaSet), err
115 // Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
116 func (c *FakeReplicaSets) Delete(name string, options *v1.DeleteOptions) error {
118 Invokes(testing.NewDeleteAction(replicasetsResource, c.ns, name), &v1beta1.ReplicaSet{})
123 // DeleteCollection deletes a collection of objects.
124 func (c *FakeReplicaSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
125 action := testing.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
127 _, err := c.Fake.Invokes(action, &v1beta1.ReplicaSetList{})
131 // Patch applies the patch and returns the patched replicaSet.
132 func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) {
134 Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, pt, data, subresources...), &v1beta1.ReplicaSet{})
139 return obj.(*v1beta1.ReplicaSet), err
142 // GetScale takes name of the replicaSet, and returns the corresponding scale object, and an error if there is any.
143 func (c *FakeReplicaSets) GetScale(replicaSetName string, options v1.GetOptions) (result *v1beta1.Scale, err error) {
145 Invokes(testing.NewGetSubresourceAction(replicasetsResource, c.ns, "scale", replicaSetName), &v1beta1.Scale{})
150 return obj.(*v1beta1.Scale), err
153 // UpdateScale takes the representation of a scale and updates it. Returns the server's representation of the scale, and an error, if there is any.
154 func (c *FakeReplicaSets) UpdateScale(replicaSetName string, scale *v1beta1.Scale) (result *v1beta1.Scale, err error) {
156 Invokes(testing.NewUpdateSubresourceAction(replicasetsResource, "scale", c.ns, scale), &v1beta1.Scale{})
161 return obj.(*v1beta1.Scale), err