From 67de9e014b58303d4e260d603b18dc8de67236e3 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Tue, 7 Nov 2017 12:42:06 -0800 Subject: [PATCH 1/2] Update generated files Kubernetes-commit: cb43840492b383f4e1b87d7108d51c6439e1dad5 --- .../admissionregistration/v1alpha1/BUILD | 2 +- .../externaladmissionhookconfiguration.go | 87 ----------- .../v1alpha1/interface.go | 14 +- .../validatingwebhookconfiguration.go | 87 +++++++++++ informers/generic.go | 4 +- .../admissionregistration/v1alpha1/BUILD | 2 +- .../v1alpha1/admissionregistration_client.go | 10 +- .../externaladmissionhookconfiguration.go | 145 ------------------ .../admissionregistration/v1alpha1/fake/BUILD | 2 +- .../fake/fake_admissionregistration_client.go | 8 +- ...fake_externaladmissionhookconfiguration.go | 118 -------------- .../fake_validatingwebhookconfiguration.go | 118 ++++++++++++++ .../v1alpha1/generated_expansion.go | 4 +- .../validatingwebhookconfiguration.go | 145 ++++++++++++++++++ listers/admissionregistration/v1alpha1/BUILD | 2 +- .../v1alpha1/expansion_generated.go | 8 +- .../externaladmissionhookconfiguration.go | 65 -------- .../validatingwebhookconfiguration.go | 65 ++++++++ 18 files changed, 443 insertions(+), 443 deletions(-) delete mode 100644 informers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go create mode 100644 informers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go delete mode 100644 kubernetes/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go delete mode 100644 kubernetes/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go create mode 100644 kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingwebhookconfiguration.go create mode 100644 kubernetes/typed/admissionregistration/v1alpha1/validatingwebhookconfiguration.go delete mode 100644 listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go create mode 100644 listers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go diff --git a/informers/admissionregistration/v1alpha1/BUILD b/informers/admissionregistration/v1alpha1/BUILD index 8684c3e6e3..6f48bbfb33 100644 --- a/informers/admissionregistration/v1alpha1/BUILD +++ b/informers/admissionregistration/v1alpha1/BUILD @@ -8,9 +8,9 @@ load( go_library( name = "go_default_library", srcs = [ - "externaladmissionhookconfiguration.go", "initializerconfiguration.go", "interface.go", + "validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/informers/admissionregistration/v1alpha1", deps = [ diff --git a/informers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go b/informers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go deleted file mode 100644 index a0c2ba48c7..0000000000 --- a/informers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by informer-gen - -package v1alpha1 - -import ( - admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - runtime "k8s.io/apimachinery/pkg/runtime" - watch "k8s.io/apimachinery/pkg/watch" - internalinterfaces "k8s.io/client-go/informers/internalinterfaces" - kubernetes "k8s.io/client-go/kubernetes" - v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" - cache "k8s.io/client-go/tools/cache" - time "time" -) - -// ExternalAdmissionHookConfigurationInformer provides access to a shared informer and lister for -// ExternalAdmissionHookConfigurations. -type ExternalAdmissionHookConfigurationInformer interface { - Informer() cache.SharedIndexInformer - Lister() v1alpha1.ExternalAdmissionHookConfigurationLister -} - -type externalAdmissionHookConfigurationInformer struct { - factory internalinterfaces.SharedInformerFactory - tweakListOptions internalinterfaces.TweakListOptionsFunc -} - -// NewExternalAdmissionHookConfigurationInformer constructs a new informer for ExternalAdmissionHookConfiguration type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewExternalAdmissionHookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { - return NewFilteredExternalAdmissionHookConfigurationInformer(client, resyncPeriod, indexers, nil) -} - -// NewFilteredExternalAdmissionHookConfigurationInformer constructs a new informer for ExternalAdmissionHookConfiguration type. -// Always prefer using an informer factory to get a shared informer instead of getting an independent -// one. This reduces memory footprint and number of connections to the server. -func NewFilteredExternalAdmissionHookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { - return cache.NewSharedIndexInformer( - &cache.ListWatch{ - ListFunc: func(options v1.ListOptions) (runtime.Object, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AdmissionregistrationV1alpha1().ExternalAdmissionHookConfigurations().List(options) - }, - WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { - if tweakListOptions != nil { - tweakListOptions(&options) - } - return client.AdmissionregistrationV1alpha1().ExternalAdmissionHookConfigurations().Watch(options) - }, - }, - &admissionregistration_v1alpha1.ExternalAdmissionHookConfiguration{}, - resyncPeriod, - indexers, - ) -} - -func (f *externalAdmissionHookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { - return NewFilteredExternalAdmissionHookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) -} - -func (f *externalAdmissionHookConfigurationInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&admissionregistration_v1alpha1.ExternalAdmissionHookConfiguration{}, f.defaultInformer) -} - -func (f *externalAdmissionHookConfigurationInformer) Lister() v1alpha1.ExternalAdmissionHookConfigurationLister { - return v1alpha1.NewExternalAdmissionHookConfigurationLister(f.Informer().GetIndexer()) -} diff --git a/informers/admissionregistration/v1alpha1/interface.go b/informers/admissionregistration/v1alpha1/interface.go index b082c0a0bb..3192d0a488 100644 --- a/informers/admissionregistration/v1alpha1/interface.go +++ b/informers/admissionregistration/v1alpha1/interface.go @@ -24,10 +24,10 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { - // ExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurationInformer. - ExternalAdmissionHookConfigurations() ExternalAdmissionHookConfigurationInformer // InitializerConfigurations returns a InitializerConfigurationInformer. InitializerConfigurations() InitializerConfigurationInformer + // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. + ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer } type version struct { @@ -41,12 +41,12 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// ExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurationInformer. -func (v *version) ExternalAdmissionHookConfigurations() ExternalAdmissionHookConfigurationInformer { - return &externalAdmissionHookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} -} - // InitializerConfigurations returns a InitializerConfigurationInformer. func (v *version) InitializerConfigurations() InitializerConfigurationInformer { return &initializerConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } + +// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. +func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { + return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} diff --git a/informers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go b/informers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go new file mode 100644 index 0000000000..2a2172eedc --- /dev/null +++ b/informers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go @@ -0,0 +1,87 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was automatically generated by informer-gen + +package v1alpha1 + +import ( + admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" + cache "k8s.io/client-go/tools/cache" + time "time" +) + +// ValidatingWebhookConfigurationInformer provides access to a shared informer and lister for +// ValidatingWebhookConfigurations. +type ValidatingWebhookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.ValidatingWebhookConfigurationLister +} + +type validatingWebhookConfigurationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredValidatingWebhookConfigurationInformer constructs a new informer for ValidatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredValidatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().ValidatingWebhookConfigurations().List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().ValidatingWebhookConfigurations().Watch(options) + }, + }, + &admissionregistration_v1alpha1.ValidatingWebhookConfiguration{}, + resyncPeriod, + indexers, + ) +} + +func (f *validatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredValidatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *validatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistration_v1alpha1.ValidatingWebhookConfiguration{}, f.defaultInformer) +} + +func (f *validatingWebhookConfigurationInformer) Lister() v1alpha1.ValidatingWebhookConfigurationLister { + return v1alpha1.NewValidatingWebhookConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/informers/generic.go b/informers/generic.go index f8ef310be2..79a8fb81d6 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -72,10 +72,10 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=admissionregistration.k8s.io, Version=v1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("externaladmissionhookconfigurations"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().ExternalAdmissionHookConfigurations().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("initializerconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().InitializerConfigurations().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().ValidatingWebhookConfigurations().Informer()}, nil // Group=apps, Version=v1 case v1.SchemeGroupVersion.WithResource("controllerrevisions"): diff --git a/kubernetes/typed/admissionregistration/v1alpha1/BUILD b/kubernetes/typed/admissionregistration/v1alpha1/BUILD index 2b27133640..8cb97c09a4 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/BUILD +++ b/kubernetes/typed/admissionregistration/v1alpha1/BUILD @@ -10,9 +10,9 @@ go_library( srcs = [ "admissionregistration_client.go", "doc.go", - "externaladmissionhookconfiguration.go", "generated_expansion.go", "initializerconfiguration.go", + "validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1", deps = [ diff --git a/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go index 95d5339197..b521f2acc0 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go @@ -25,8 +25,8 @@ import ( type AdmissionregistrationV1alpha1Interface interface { RESTClient() rest.Interface - ExternalAdmissionHookConfigurationsGetter InitializerConfigurationsGetter + ValidatingWebhookConfigurationsGetter } // AdmissionregistrationV1alpha1Client is used to interact with features provided by the admissionregistration.k8s.io group. @@ -34,14 +34,14 @@ type AdmissionregistrationV1alpha1Client struct { restClient rest.Interface } -func (c *AdmissionregistrationV1alpha1Client) ExternalAdmissionHookConfigurations() ExternalAdmissionHookConfigurationInterface { - return newExternalAdmissionHookConfigurations(c) -} - func (c *AdmissionregistrationV1alpha1Client) InitializerConfigurations() InitializerConfigurationInterface { return newInitializerConfigurations(c) } +func (c *AdmissionregistrationV1alpha1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface { + return newValidatingWebhookConfigurations(c) +} + // NewForConfig creates a new AdmissionregistrationV1alpha1Client for the given config. func NewForConfig(c *rest.Config) (*AdmissionregistrationV1alpha1Client, error) { config := *c diff --git a/kubernetes/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go b/kubernetes/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go deleted file mode 100644 index 1ddc6eb48c..0000000000 --- a/kubernetes/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go +++ /dev/null @@ -1,145 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package v1alpha1 - -import ( - v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - scheme "k8s.io/client-go/kubernetes/scheme" - rest "k8s.io/client-go/rest" -) - -// ExternalAdmissionHookConfigurationsGetter has a method to return a ExternalAdmissionHookConfigurationInterface. -// A group's client should implement this interface. -type ExternalAdmissionHookConfigurationsGetter interface { - ExternalAdmissionHookConfigurations() ExternalAdmissionHookConfigurationInterface -} - -// ExternalAdmissionHookConfigurationInterface has methods to work with ExternalAdmissionHookConfiguration resources. -type ExternalAdmissionHookConfigurationInterface interface { - Create(*v1alpha1.ExternalAdmissionHookConfiguration) (*v1alpha1.ExternalAdmissionHookConfiguration, error) - Update(*v1alpha1.ExternalAdmissionHookConfiguration) (*v1alpha1.ExternalAdmissionHookConfiguration, error) - Delete(name string, options *v1.DeleteOptions) error - DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1alpha1.ExternalAdmissionHookConfiguration, error) - List(opts v1.ListOptions) (*v1alpha1.ExternalAdmissionHookConfigurationList, error) - Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) - ExternalAdmissionHookConfigurationExpansion -} - -// externalAdmissionHookConfigurations implements ExternalAdmissionHookConfigurationInterface -type externalAdmissionHookConfigurations struct { - client rest.Interface -} - -// newExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurations -func newExternalAdmissionHookConfigurations(c *AdmissionregistrationV1alpha1Client) *externalAdmissionHookConfigurations { - return &externalAdmissionHookConfigurations{ - client: c.RESTClient(), - } -} - -// Get takes name of the externalAdmissionHookConfiguration, and returns the corresponding externalAdmissionHookConfiguration object, and an error if there is any. -func (c *externalAdmissionHookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - result = &v1alpha1.ExternalAdmissionHookConfiguration{} - err = c.client.Get(). - Resource("externaladmissionhookconfigurations"). - Name(name). - VersionedParams(&options, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// List takes label and field selectors, and returns the list of ExternalAdmissionHookConfigurations that match those selectors. -func (c *externalAdmissionHookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.ExternalAdmissionHookConfigurationList, err error) { - result = &v1alpha1.ExternalAdmissionHookConfigurationList{} - err = c.client.Get(). - Resource("externaladmissionhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Do(). - Into(result) - return -} - -// Watch returns a watch.Interface that watches the requested externalAdmissionHookConfigurations. -func (c *externalAdmissionHookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { - opts.Watch = true - return c.client.Get(). - Resource("externaladmissionhookconfigurations"). - VersionedParams(&opts, scheme.ParameterCodec). - Watch() -} - -// Create takes the representation of a externalAdmissionHookConfiguration and creates it. Returns the server's representation of the externalAdmissionHookConfiguration, and an error, if there is any. -func (c *externalAdmissionHookConfigurations) Create(externalAdmissionHookConfiguration *v1alpha1.ExternalAdmissionHookConfiguration) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - result = &v1alpha1.ExternalAdmissionHookConfiguration{} - err = c.client.Post(). - Resource("externaladmissionhookconfigurations"). - Body(externalAdmissionHookConfiguration). - Do(). - Into(result) - return -} - -// Update takes the representation of a externalAdmissionHookConfiguration and updates it. Returns the server's representation of the externalAdmissionHookConfiguration, and an error, if there is any. -func (c *externalAdmissionHookConfigurations) Update(externalAdmissionHookConfiguration *v1alpha1.ExternalAdmissionHookConfiguration) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - result = &v1alpha1.ExternalAdmissionHookConfiguration{} - err = c.client.Put(). - Resource("externaladmissionhookconfigurations"). - Name(externalAdmissionHookConfiguration.Name). - Body(externalAdmissionHookConfiguration). - Do(). - Into(result) - return -} - -// Delete takes name of the externalAdmissionHookConfiguration and deletes it. Returns an error if one occurs. -func (c *externalAdmissionHookConfigurations) Delete(name string, options *v1.DeleteOptions) error { - return c.client.Delete(). - Resource("externaladmissionhookconfigurations"). - Name(name). - Body(options). - Do(). - Error() -} - -// DeleteCollection deletes a collection of objects. -func (c *externalAdmissionHookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - return c.client.Delete(). - Resource("externaladmissionhookconfigurations"). - VersionedParams(&listOptions, scheme.ParameterCodec). - Body(options). - Do(). - Error() -} - -// Patch applies the patch and returns the patched externalAdmissionHookConfiguration. -func (c *externalAdmissionHookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - result = &v1alpha1.ExternalAdmissionHookConfiguration{} - err = c.client.Patch(pt). - Resource("externaladmissionhookconfigurations"). - SubResource(subresources...). - Name(name). - Body(data). - Do(). - Into(result) - return -} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD b/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD index a567ec24ec..07b9ccb6d9 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD @@ -10,8 +10,8 @@ go_library( srcs = [ "doc.go", "fake_admissionregistration_client.go", - "fake_externaladmissionhookconfiguration.go", "fake_initializerconfiguration.go", + "fake_validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake", deps = [ diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go index 8c370a9f70..e329fd8e15 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go @@ -26,14 +26,14 @@ type FakeAdmissionregistrationV1alpha1 struct { *testing.Fake } -func (c *FakeAdmissionregistrationV1alpha1) ExternalAdmissionHookConfigurations() v1alpha1.ExternalAdmissionHookConfigurationInterface { - return &FakeExternalAdmissionHookConfigurations{c} -} - func (c *FakeAdmissionregistrationV1alpha1) InitializerConfigurations() v1alpha1.InitializerConfigurationInterface { return &FakeInitializerConfigurations{c} } +func (c *FakeAdmissionregistrationV1alpha1) ValidatingWebhookConfigurations() v1alpha1.ValidatingWebhookConfigurationInterface { + return &FakeValidatingWebhookConfigurations{c} +} + // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. func (c *FakeAdmissionregistrationV1alpha1) RESTClient() rest.Interface { diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go deleted file mode 100644 index a0143db3b7..0000000000 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go +++ /dev/null @@ -1,118 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fake - -import ( - v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - labels "k8s.io/apimachinery/pkg/labels" - schema "k8s.io/apimachinery/pkg/runtime/schema" - types "k8s.io/apimachinery/pkg/types" - watch "k8s.io/apimachinery/pkg/watch" - testing "k8s.io/client-go/testing" -) - -// FakeExternalAdmissionHookConfigurations implements ExternalAdmissionHookConfigurationInterface -type FakeExternalAdmissionHookConfigurations struct { - Fake *FakeAdmissionregistrationV1alpha1 -} - -var externaladmissionhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "externaladmissionhookconfigurations"} - -var externaladmissionhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ExternalAdmissionHookConfiguration"} - -// Get takes name of the externalAdmissionHookConfiguration, and returns the corresponding externalAdmissionHookConfiguration object, and an error if there is any. -func (c *FakeExternalAdmissionHookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootGetAction(externaladmissionhookconfigurationsResource, name), &v1alpha1.ExternalAdmissionHookConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err -} - -// List takes label and field selectors, and returns the list of ExternalAdmissionHookConfigurations that match those selectors. -func (c *FakeExternalAdmissionHookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.ExternalAdmissionHookConfigurationList, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootListAction(externaladmissionhookconfigurationsResource, externaladmissionhookconfigurationsKind, opts), &v1alpha1.ExternalAdmissionHookConfigurationList{}) - if obj == nil { - return nil, err - } - - label, _, _ := testing.ExtractFromListOptions(opts) - if label == nil { - label = labels.Everything() - } - list := &v1alpha1.ExternalAdmissionHookConfigurationList{} - for _, item := range obj.(*v1alpha1.ExternalAdmissionHookConfigurationList).Items { - if label.Matches(labels.Set(item.Labels)) { - list.Items = append(list.Items, item) - } - } - return list, err -} - -// Watch returns a watch.Interface that watches the requested externalAdmissionHookConfigurations. -func (c *FakeExternalAdmissionHookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { - return c.Fake. - InvokesWatch(testing.NewRootWatchAction(externaladmissionhookconfigurationsResource, opts)) -} - -// Create takes the representation of a externalAdmissionHookConfiguration and creates it. Returns the server's representation of the externalAdmissionHookConfiguration, and an error, if there is any. -func (c *FakeExternalAdmissionHookConfigurations) Create(externalAdmissionHookConfiguration *v1alpha1.ExternalAdmissionHookConfiguration) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootCreateAction(externaladmissionhookconfigurationsResource, externalAdmissionHookConfiguration), &v1alpha1.ExternalAdmissionHookConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err -} - -// Update takes the representation of a externalAdmissionHookConfiguration and updates it. Returns the server's representation of the externalAdmissionHookConfiguration, and an error, if there is any. -func (c *FakeExternalAdmissionHookConfigurations) Update(externalAdmissionHookConfiguration *v1alpha1.ExternalAdmissionHookConfiguration) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootUpdateAction(externaladmissionhookconfigurationsResource, externalAdmissionHookConfiguration), &v1alpha1.ExternalAdmissionHookConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err -} - -// Delete takes name of the externalAdmissionHookConfiguration and deletes it. Returns an error if one occurs. -func (c *FakeExternalAdmissionHookConfigurations) Delete(name string, options *v1.DeleteOptions) error { - _, err := c.Fake. - Invokes(testing.NewRootDeleteAction(externaladmissionhookconfigurationsResource, name), &v1alpha1.ExternalAdmissionHookConfiguration{}) - return err -} - -// DeleteCollection deletes a collection of objects. -func (c *FakeExternalAdmissionHookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { - action := testing.NewRootDeleteCollectionAction(externaladmissionhookconfigurationsResource, listOptions) - - _, err := c.Fake.Invokes(action, &v1alpha1.ExternalAdmissionHookConfigurationList{}) - return err -} - -// Patch applies the patch and returns the patched externalAdmissionHookConfiguration. -func (c *FakeExternalAdmissionHookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { - obj, err := c.Fake. - Invokes(testing.NewRootPatchSubresourceAction(externaladmissionhookconfigurationsResource, name, data, subresources...), &v1alpha1.ExternalAdmissionHookConfiguration{}) - if obj == nil { - return nil, err - } - return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err -} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingwebhookconfiguration.go new file mode 100644 index 0000000000..f3067525ea --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_validatingwebhookconfiguration.go @@ -0,0 +1,118 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeValidatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface +type FakeValidatingWebhookConfigurations struct { + Fake *FakeAdmissionregistrationV1alpha1 +} + +var validatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "validatingwebhookconfigurations"} + +var validatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ValidatingWebhookConfiguration"} + +// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. +func (c *FakeValidatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(validatingwebhookconfigurationsResource, name), &v1alpha1.ValidatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ValidatingWebhookConfiguration), err +} + +// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. +func (c *FakeValidatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.ValidatingWebhookConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(validatingwebhookconfigurationsResource, validatingwebhookconfigurationsKind, opts), &v1alpha1.ValidatingWebhookConfigurationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ValidatingWebhookConfigurationList{} + for _, item := range obj.(*v1alpha1.ValidatingWebhookConfigurationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. +func (c *FakeValidatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(validatingwebhookconfigurationsResource, opts)) +} + +// 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. +func (c *FakeValidatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1alpha1.ValidatingWebhookConfiguration) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1alpha1.ValidatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ValidatingWebhookConfiguration), err +} + +// 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. +func (c *FakeValidatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1alpha1.ValidatingWebhookConfiguration) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(validatingwebhookconfigurationsResource, validatingWebhookConfiguration), &v1alpha1.ValidatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ValidatingWebhookConfiguration), err +} + +// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. +func (c *FakeValidatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(validatingwebhookconfigurationsResource, name), &v1alpha1.ValidatingWebhookConfiguration{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeValidatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(validatingwebhookconfigurationsResource, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.ValidatingWebhookConfigurationList{}) + return err +} + +// Patch applies the patch and returns the patched validatingWebhookConfiguration. +func (c *FakeValidatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(validatingwebhookconfigurationsResource, name, data, subresources...), &v1alpha1.ValidatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ValidatingWebhookConfiguration), err +} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go b/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go index eef439ab47..5444ce2626 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go @@ -16,6 +16,6 @@ limitations under the License. package v1alpha1 -type ExternalAdmissionHookConfigurationExpansion interface{} - type InitializerConfigurationExpansion interface{} + +type ValidatingWebhookConfigurationExpansion interface{} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1alpha1/validatingwebhookconfiguration.go new file mode 100644 index 0000000000..99096b7512 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1alpha1/validatingwebhookconfiguration.go @@ -0,0 +1,145 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// ValidatingWebhookConfigurationsGetter has a method to return a ValidatingWebhookConfigurationInterface. +// A group's client should implement this interface. +type ValidatingWebhookConfigurationsGetter interface { + ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface +} + +// ValidatingWebhookConfigurationInterface has methods to work with ValidatingWebhookConfiguration resources. +type ValidatingWebhookConfigurationInterface interface { + Create(*v1alpha1.ValidatingWebhookConfiguration) (*v1alpha1.ValidatingWebhookConfiguration, error) + Update(*v1alpha1.ValidatingWebhookConfiguration) (*v1alpha1.ValidatingWebhookConfiguration, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.ValidatingWebhookConfiguration, error) + List(opts v1.ListOptions) (*v1alpha1.ValidatingWebhookConfigurationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ValidatingWebhookConfiguration, err error) + ValidatingWebhookConfigurationExpansion +} + +// validatingWebhookConfigurations implements ValidatingWebhookConfigurationInterface +type validatingWebhookConfigurations struct { + client rest.Interface +} + +// newValidatingWebhookConfigurations returns a ValidatingWebhookConfigurations +func newValidatingWebhookConfigurations(c *AdmissionregistrationV1alpha1Client) *validatingWebhookConfigurations { + return &validatingWebhookConfigurations{ + client: c.RESTClient(), + } +} + +// Get takes name of the validatingWebhookConfiguration, and returns the corresponding validatingWebhookConfiguration object, and an error if there is any. +func (c *validatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + result = &v1alpha1.ValidatingWebhookConfiguration{} + err = c.client.Get(). + Resource("validatingwebhookconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. +func (c *validatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.ValidatingWebhookConfigurationList, err error) { + result = &v1alpha1.ValidatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested validatingWebhookConfigurations. +func (c *validatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// 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. +func (c *validatingWebhookConfigurations) Create(validatingWebhookConfiguration *v1alpha1.ValidatingWebhookConfiguration) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + result = &v1alpha1.ValidatingWebhookConfiguration{} + err = c.client.Post(). + Resource("validatingwebhookconfigurations"). + Body(validatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// 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. +func (c *validatingWebhookConfigurations) Update(validatingWebhookConfiguration *v1alpha1.ValidatingWebhookConfiguration) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + result = &v1alpha1.ValidatingWebhookConfiguration{} + err = c.client.Put(). + Resource("validatingwebhookconfigurations"). + Name(validatingWebhookConfiguration.Name). + Body(validatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the validatingWebhookConfiguration and deletes it. Returns an error if one occurs. +func (c *validatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Resource("validatingwebhookconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *validatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Resource("validatingwebhookconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched validatingWebhookConfiguration. +func (c *validatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ValidatingWebhookConfiguration, err error) { + result = &v1alpha1.ValidatingWebhookConfiguration{} + err = c.client.Patch(pt). + Resource("validatingwebhookconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/listers/admissionregistration/v1alpha1/BUILD b/listers/admissionregistration/v1alpha1/BUILD index 1322950313..8e82474716 100644 --- a/listers/admissionregistration/v1alpha1/BUILD +++ b/listers/admissionregistration/v1alpha1/BUILD @@ -9,8 +9,8 @@ go_library( name = "go_default_library", srcs = [ "expansion_generated.go", - "externaladmissionhookconfiguration.go", "initializerconfiguration.go", + "validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/listers/admissionregistration/v1alpha1", deps = [ diff --git a/listers/admissionregistration/v1alpha1/expansion_generated.go b/listers/admissionregistration/v1alpha1/expansion_generated.go index 5d9f14708f..910b046a08 100644 --- a/listers/admissionregistration/v1alpha1/expansion_generated.go +++ b/listers/admissionregistration/v1alpha1/expansion_generated.go @@ -18,10 +18,10 @@ limitations under the License. package v1alpha1 -// ExternalAdmissionHookConfigurationListerExpansion allows custom methods to be added to -// ExternalAdmissionHookConfigurationLister. -type ExternalAdmissionHookConfigurationListerExpansion interface{} - // InitializerConfigurationListerExpansion allows custom methods to be added to // InitializerConfigurationLister. type InitializerConfigurationListerExpansion interface{} + +// ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to +// ValidatingWebhookConfigurationLister. +type ValidatingWebhookConfigurationListerExpansion interface{} diff --git a/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go b/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go deleted file mode 100644 index 490fc4155e..0000000000 --- a/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// This file was automatically generated by lister-gen - -package v1alpha1 - -import ( - v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" - "k8s.io/apimachinery/pkg/api/errors" - "k8s.io/apimachinery/pkg/labels" - "k8s.io/client-go/tools/cache" -) - -// ExternalAdmissionHookConfigurationLister helps list ExternalAdmissionHookConfigurations. -type ExternalAdmissionHookConfigurationLister interface { - // List lists all ExternalAdmissionHookConfigurations in the indexer. - List(selector labels.Selector) (ret []*v1alpha1.ExternalAdmissionHookConfiguration, err error) - // Get retrieves the ExternalAdmissionHookConfiguration from the index for a given name. - Get(name string) (*v1alpha1.ExternalAdmissionHookConfiguration, error) - ExternalAdmissionHookConfigurationListerExpansion -} - -// externalAdmissionHookConfigurationLister implements the ExternalAdmissionHookConfigurationLister interface. -type externalAdmissionHookConfigurationLister struct { - indexer cache.Indexer -} - -// NewExternalAdmissionHookConfigurationLister returns a new ExternalAdmissionHookConfigurationLister. -func NewExternalAdmissionHookConfigurationLister(indexer cache.Indexer) ExternalAdmissionHookConfigurationLister { - return &externalAdmissionHookConfigurationLister{indexer: indexer} -} - -// List lists all ExternalAdmissionHookConfigurations in the indexer. -func (s *externalAdmissionHookConfigurationLister) List(selector labels.Selector) (ret []*v1alpha1.ExternalAdmissionHookConfiguration, err error) { - err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1alpha1.ExternalAdmissionHookConfiguration)) - }) - return ret, err -} - -// Get retrieves the ExternalAdmissionHookConfiguration from the index for a given name. -func (s *externalAdmissionHookConfigurationLister) Get(name string) (*v1alpha1.ExternalAdmissionHookConfiguration, error) { - obj, exists, err := s.indexer.GetByKey(name) - if err != nil { - return nil, err - } - if !exists { - return nil, errors.NewNotFound(v1alpha1.Resource("externaladmissionhookconfiguration"), name) - } - return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), nil -} diff --git a/listers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go b/listers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go new file mode 100644 index 0000000000..5a57c2e5a8 --- /dev/null +++ b/listers/admissionregistration/v1alpha1/validatingwebhookconfiguration.go @@ -0,0 +1,65 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was automatically generated by lister-gen + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ValidatingWebhookConfigurationLister helps list ValidatingWebhookConfigurations. +type ValidatingWebhookConfigurationLister interface { + // List lists all ValidatingWebhookConfigurations in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.ValidatingWebhookConfiguration, err error) + // Get retrieves the ValidatingWebhookConfiguration from the index for a given name. + Get(name string) (*v1alpha1.ValidatingWebhookConfiguration, error) + ValidatingWebhookConfigurationListerExpansion +} + +// validatingWebhookConfigurationLister implements the ValidatingWebhookConfigurationLister interface. +type validatingWebhookConfigurationLister struct { + indexer cache.Indexer +} + +// NewValidatingWebhookConfigurationLister returns a new ValidatingWebhookConfigurationLister. +func NewValidatingWebhookConfigurationLister(indexer cache.Indexer) ValidatingWebhookConfigurationLister { + return &validatingWebhookConfigurationLister{indexer: indexer} +} + +// List lists all ValidatingWebhookConfigurations in the indexer. +func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1alpha1.ValidatingWebhookConfiguration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ValidatingWebhookConfiguration)) + }) + return ret, err +} + +// Get retrieves the ValidatingWebhookConfiguration from the index for a given name. +func (s *validatingWebhookConfigurationLister) Get(name string) (*v1alpha1.ValidatingWebhookConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("validatingwebhookconfiguration"), name) + } + return obj.(*v1alpha1.ValidatingWebhookConfiguration), nil +} From c32c36a1bcd5aaf42847b66c40bffc6cadc4a023 Mon Sep 17 00:00:00 2001 From: mbohlool Date: Tue, 7 Nov 2017 17:29:01 -0800 Subject: [PATCH 2/2] Update generated files for MutatingWebhookConfiguration Kubernetes-commit: 4568e0530c53df81d1bbd5e700daca041a1d8439 --- .../admissionregistration/v1alpha1/BUILD | 1 + .../v1alpha1/interface.go | 7 + .../v1alpha1/mutatingwebhookconfiguration.go | 87 +++++++++++ informers/generic.go | 2 + .../admissionregistration/v1alpha1/BUILD | 1 + .../v1alpha1/admissionregistration_client.go | 5 + .../admissionregistration/v1alpha1/fake/BUILD | 1 + .../fake/fake_admissionregistration_client.go | 4 + .../fake/fake_mutatingwebhookconfiguration.go | 118 ++++++++++++++ .../v1alpha1/generated_expansion.go | 2 + .../v1alpha1/mutatingwebhookconfiguration.go | 145 ++++++++++++++++++ listers/admissionregistration/v1alpha1/BUILD | 1 + .../v1alpha1/expansion_generated.go | 4 + .../v1alpha1/mutatingwebhookconfiguration.go | 65 ++++++++ 14 files changed, 443 insertions(+) create mode 100644 informers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go create mode 100644 kubernetes/typed/admissionregistration/v1alpha1/fake/fake_mutatingwebhookconfiguration.go create mode 100644 kubernetes/typed/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go create mode 100644 listers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go diff --git a/informers/admissionregistration/v1alpha1/BUILD b/informers/admissionregistration/v1alpha1/BUILD index 6f48bbfb33..4419a62450 100644 --- a/informers/admissionregistration/v1alpha1/BUILD +++ b/informers/admissionregistration/v1alpha1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "initializerconfiguration.go", "interface.go", + "mutatingwebhookconfiguration.go", "validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/informers/admissionregistration/v1alpha1", diff --git a/informers/admissionregistration/v1alpha1/interface.go b/informers/admissionregistration/v1alpha1/interface.go index 3192d0a488..cab109f73b 100644 --- a/informers/admissionregistration/v1alpha1/interface.go +++ b/informers/admissionregistration/v1alpha1/interface.go @@ -26,6 +26,8 @@ import ( type Interface interface { // InitializerConfigurations returns a InitializerConfigurationInformer. InitializerConfigurations() InitializerConfigurationInformer + // MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. + MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer } @@ -46,6 +48,11 @@ func (v *version) InitializerConfigurations() InitializerConfigurationInformer { return &initializerConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} } +// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer. +func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer { + return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer. func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} diff --git a/informers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go b/informers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go new file mode 100644 index 0000000000..6f407779a5 --- /dev/null +++ b/informers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go @@ -0,0 +1,87 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was automatically generated by informer-gen + +package v1alpha1 + +import ( + admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + internalinterfaces "k8s.io/client-go/informers/internalinterfaces" + kubernetes "k8s.io/client-go/kubernetes" + v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1" + cache "k8s.io/client-go/tools/cache" + time "time" +) + +// MutatingWebhookConfigurationInformer provides access to a shared informer and lister for +// MutatingWebhookConfigurations. +type MutatingWebhookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.MutatingWebhookConfigurationLister +} + +type mutatingWebhookConfigurationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().MutatingWebhookConfigurations().List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.AdmissionregistrationV1alpha1().MutatingWebhookConfigurations().Watch(options) + }, + }, + &admissionregistration_v1alpha1.MutatingWebhookConfiguration{}, + resyncPeriod, + indexers, + ) +} + +func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistration_v1alpha1.MutatingWebhookConfiguration{}, f.defaultInformer) +} + +func (f *mutatingWebhookConfigurationInformer) Lister() v1alpha1.MutatingWebhookConfigurationLister { + return v1alpha1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/informers/generic.go b/informers/generic.go index 79a8fb81d6..936910ada0 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -74,6 +74,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource // Group=admissionregistration.k8s.io, Version=v1alpha1 case v1alpha1.SchemeGroupVersion.WithResource("initializerconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().InitializerConfigurations().Informer()}, nil + case v1alpha1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().MutatingWebhookConfigurations().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"): return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().ValidatingWebhookConfigurations().Informer()}, nil diff --git a/kubernetes/typed/admissionregistration/v1alpha1/BUILD b/kubernetes/typed/admissionregistration/v1alpha1/BUILD index 8cb97c09a4..2ea025f92b 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/BUILD +++ b/kubernetes/typed/admissionregistration/v1alpha1/BUILD @@ -12,6 +12,7 @@ go_library( "doc.go", "generated_expansion.go", "initializerconfiguration.go", + "mutatingwebhookconfiguration.go", "validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1", diff --git a/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go index b521f2acc0..2abd80f89f 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/admissionregistration_client.go @@ -26,6 +26,7 @@ import ( type AdmissionregistrationV1alpha1Interface interface { RESTClient() rest.Interface InitializerConfigurationsGetter + MutatingWebhookConfigurationsGetter ValidatingWebhookConfigurationsGetter } @@ -38,6 +39,10 @@ func (c *AdmissionregistrationV1alpha1Client) InitializerConfigurations() Initia return newInitializerConfigurations(c) } +func (c *AdmissionregistrationV1alpha1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface { + return newMutatingWebhookConfigurations(c) +} + func (c *AdmissionregistrationV1alpha1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface { return newValidatingWebhookConfigurations(c) } diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD b/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD index 07b9ccb6d9..c21cf77a0d 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD @@ -11,6 +11,7 @@ go_library( "doc.go", "fake_admissionregistration_client.go", "fake_initializerconfiguration.go", + "fake_mutatingwebhookconfiguration.go", "fake_validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake", diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go index e329fd8e15..9c0dd8b874 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go @@ -30,6 +30,10 @@ func (c *FakeAdmissionregistrationV1alpha1) InitializerConfigurations() v1alpha1 return &FakeInitializerConfigurations{c} } +func (c *FakeAdmissionregistrationV1alpha1) MutatingWebhookConfigurations() v1alpha1.MutatingWebhookConfigurationInterface { + return &FakeMutatingWebhookConfigurations{c} +} + func (c *FakeAdmissionregistrationV1alpha1) ValidatingWebhookConfigurations() v1alpha1.ValidatingWebhookConfigurationInterface { return &FakeValidatingWebhookConfigurations{c} } diff --git a/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_mutatingwebhookconfiguration.go new file mode 100644 index 0000000000..94c8df1386 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1alpha1/fake/fake_mutatingwebhookconfiguration.go @@ -0,0 +1,118 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package fake + +import ( + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface +type FakeMutatingWebhookConfigurations struct { + Fake *FakeAdmissionregistrationV1alpha1 +} + +var mutatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "mutatingwebhookconfigurations"} + +var mutatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "MutatingWebhookConfiguration"} + +// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. +func (c *FakeMutatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1alpha1.MutatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MutatingWebhookConfiguration), err +} + +// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. +func (c *FakeMutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.MutatingWebhookConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1alpha1.MutatingWebhookConfigurationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.MutatingWebhookConfigurationList{} + for _, item := range obj.(*v1alpha1.MutatingWebhookConfigurationList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. +func (c *FakeMutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts)) +} + +// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. +func (c *FakeMutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1alpha1.MutatingWebhookConfiguration) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1alpha1.MutatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MutatingWebhookConfiguration), err +} + +// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. +func (c *FakeMutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1alpha1.MutatingWebhookConfiguration) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1alpha1.MutatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MutatingWebhookConfiguration), err +} + +// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. +func (c *FakeMutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &v1alpha1.MutatingWebhookConfiguration{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.MutatingWebhookConfigurationList{}) + return err +} + +// Patch applies the patch and returns the patched mutatingWebhookConfiguration. +func (c *FakeMutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, data, subresources...), &v1alpha1.MutatingWebhookConfiguration{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.MutatingWebhookConfiguration), err +} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go b/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go index 5444ce2626..17f7326c2c 100644 --- a/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go +++ b/kubernetes/typed/admissionregistration/v1alpha1/generated_expansion.go @@ -18,4 +18,6 @@ package v1alpha1 type InitializerConfigurationExpansion interface{} +type MutatingWebhookConfigurationExpansion interface{} + type ValidatingWebhookConfigurationExpansion interface{} diff --git a/kubernetes/typed/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go new file mode 100644 index 0000000000..3d645b9039 --- /dev/null +++ b/kubernetes/typed/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go @@ -0,0 +1,145 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + scheme "k8s.io/client-go/kubernetes/scheme" + rest "k8s.io/client-go/rest" +) + +// MutatingWebhookConfigurationsGetter has a method to return a MutatingWebhookConfigurationInterface. +// A group's client should implement this interface. +type MutatingWebhookConfigurationsGetter interface { + MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface +} + +// MutatingWebhookConfigurationInterface has methods to work with MutatingWebhookConfiguration resources. +type MutatingWebhookConfigurationInterface interface { + Create(*v1alpha1.MutatingWebhookConfiguration) (*v1alpha1.MutatingWebhookConfiguration, error) + Update(*v1alpha1.MutatingWebhookConfiguration) (*v1alpha1.MutatingWebhookConfiguration, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.MutatingWebhookConfiguration, error) + List(opts v1.ListOptions) (*v1alpha1.MutatingWebhookConfigurationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MutatingWebhookConfiguration, err error) + MutatingWebhookConfigurationExpansion +} + +// mutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface +type mutatingWebhookConfigurations struct { + client rest.Interface +} + +// newMutatingWebhookConfigurations returns a MutatingWebhookConfigurations +func newMutatingWebhookConfigurations(c *AdmissionregistrationV1alpha1Client) *mutatingWebhookConfigurations { + return &mutatingWebhookConfigurations{ + client: c.RESTClient(), + } +} + +// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any. +func (c *mutatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + result = &v1alpha1.MutatingWebhookConfiguration{} + err = c.client.Get(). + Resource("mutatingwebhookconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. +func (c *mutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.MutatingWebhookConfigurationList, err error) { + result = &v1alpha1.MutatingWebhookConfigurationList{} + err = c.client.Get(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations. +func (c *mutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. +func (c *mutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1alpha1.MutatingWebhookConfiguration) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + result = &v1alpha1.MutatingWebhookConfiguration{} + err = c.client.Post(). + Resource("mutatingwebhookconfigurations"). + Body(mutatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any. +func (c *mutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1alpha1.MutatingWebhookConfiguration) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + result = &v1alpha1.MutatingWebhookConfiguration{} + err = c.client.Put(). + Resource("mutatingwebhookconfigurations"). + Name(mutatingWebhookConfiguration.Name). + Body(mutatingWebhookConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs. +func (c *mutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Resource("mutatingwebhookconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *mutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Resource("mutatingwebhookconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched mutatingWebhookConfiguration. +func (c *mutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MutatingWebhookConfiguration, err error) { + result = &v1alpha1.MutatingWebhookConfiguration{} + err = c.client.Patch(pt). + Resource("mutatingwebhookconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/listers/admissionregistration/v1alpha1/BUILD b/listers/admissionregistration/v1alpha1/BUILD index 8e82474716..387deca86c 100644 --- a/listers/admissionregistration/v1alpha1/BUILD +++ b/listers/admissionregistration/v1alpha1/BUILD @@ -10,6 +10,7 @@ go_library( srcs = [ "expansion_generated.go", "initializerconfiguration.go", + "mutatingwebhookconfiguration.go", "validatingwebhookconfiguration.go", ], importpath = "k8s.io/client-go/listers/admissionregistration/v1alpha1", diff --git a/listers/admissionregistration/v1alpha1/expansion_generated.go b/listers/admissionregistration/v1alpha1/expansion_generated.go index 910b046a08..a0d51f1cfb 100644 --- a/listers/admissionregistration/v1alpha1/expansion_generated.go +++ b/listers/admissionregistration/v1alpha1/expansion_generated.go @@ -22,6 +22,10 @@ package v1alpha1 // InitializerConfigurationLister. type InitializerConfigurationListerExpansion interface{} +// MutatingWebhookConfigurationListerExpansion allows custom methods to be added to +// MutatingWebhookConfigurationLister. +type MutatingWebhookConfigurationListerExpansion interface{} + // ValidatingWebhookConfigurationListerExpansion allows custom methods to be added to // ValidatingWebhookConfigurationLister. type ValidatingWebhookConfigurationListerExpansion interface{} diff --git a/listers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go b/listers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go new file mode 100644 index 0000000000..99ccc30967 --- /dev/null +++ b/listers/admissionregistration/v1alpha1/mutatingwebhookconfiguration.go @@ -0,0 +1,65 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// This file was automatically generated by lister-gen + +package v1alpha1 + +import ( + v1alpha1 "k8s.io/api/admissionregistration/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// MutatingWebhookConfigurationLister helps list MutatingWebhookConfigurations. +type MutatingWebhookConfigurationLister interface { + // List lists all MutatingWebhookConfigurations in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.MutatingWebhookConfiguration, err error) + // Get retrieves the MutatingWebhookConfiguration from the index for a given name. + Get(name string) (*v1alpha1.MutatingWebhookConfiguration, error) + MutatingWebhookConfigurationListerExpansion +} + +// mutatingWebhookConfigurationLister implements the MutatingWebhookConfigurationLister interface. +type mutatingWebhookConfigurationLister struct { + indexer cache.Indexer +} + +// NewMutatingWebhookConfigurationLister returns a new MutatingWebhookConfigurationLister. +func NewMutatingWebhookConfigurationLister(indexer cache.Indexer) MutatingWebhookConfigurationLister { + return &mutatingWebhookConfigurationLister{indexer: indexer} +} + +// List lists all MutatingWebhookConfigurations in the indexer. +func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*v1alpha1.MutatingWebhookConfiguration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.MutatingWebhookConfiguration)) + }) + return ret, err +} + +// Get retrieves the MutatingWebhookConfiguration from the index for a given name. +func (s *mutatingWebhookConfigurationLister) Get(name string) (*v1alpha1.MutatingWebhookConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("mutatingwebhookconfiguration"), name) + } + return obj.(*v1alpha1.MutatingWebhookConfiguration), nil +}