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/admissionregistration/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 // FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface
32 type FakeValidatingWebhookConfigurations struct {
33 Fake *FakeAdmissionregistrationV1beta1
36 var validatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1beta1", Resource: "validatingwebhookconfigurations"}
38 var validatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1beta1", Kind: "ValidatingWebhookConfiguration"}
40 // Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any.
41 func (c *FakeValidatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
43 Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{})
47 return obj.(*v1beta1.ValidatingWebhookConfiguration), err
50 // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors.
51 func (c *FakeValidatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1beta1.ValidatingWebhookConfigurationList, err error) {
53 Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1beta1.ValidatingWebhookConfigurationList{})
58 label, _, _ := testing.ExtractFromListOptions(opts)
60 label = labels.Everything()
62 list := &v1beta1.ValidatingWebhookConfigurationList{ListMeta: obj.(*v1beta1.ValidatingWebhookConfigurationList).ListMeta}
63 for _, item := range obj.(*v1beta1.ValidatingWebhookConfigurationList).Items {
64 if label.Matches(labels.Set(item.Labels)) {
65 list.Items = append(list.Items, item)
71 // Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations.
72 func (c *FakeValidatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) {
74 InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts))
77 // Create takes the representation of a validatingWebhookConfiguration and creates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
78 func (c *FakeValidatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
80 Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{})
84 return obj.(*v1beta1.ValidatingWebhookConfiguration), err
87 // Update takes the representation of a validatingWebhookConfiguration and updates it. Returns the server's representation of the validatingWebhookConfiguration, and an error, if there is any.
88 func (c *FakeValidatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1beta1.ValidatingWebhookConfiguration) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
90 Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1beta1.ValidatingWebhookConfiguration{})
94 return obj.(*v1beta1.ValidatingWebhookConfiguration), err
97 // Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs.
98 func (c *FakeValidatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error {
100 Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &v1beta1.ValidatingWebhookConfiguration{})
104 // DeleteCollection deletes a collection of objects.
105 func (c *FakeValidatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
106 action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions)
108 _, err := c.Fake.Invokes(action, &v1beta1.ValidatingWebhookConfigurationList{})
112 // Patch applies the patch and returns the patched validatingWebhookConfiguration.
113 func (c *FakeValidatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ValidatingWebhookConfiguration, err error) {
115 Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, pt, data, subresources...), &v1beta1.ValidatingWebhookConfiguration{})
119 return obj.(*v1beta1.ValidatingWebhookConfiguration), err