diff --git a/cmd/libs/go2idl/client-gen/main.go b/cmd/libs/go2idl/client-gen/main.go index fa760bdcd62..4bb4c160a24 100644 --- a/cmd/libs/go2idl/client-gen/main.go +++ b/cmd/libs/go2idl/client-gen/main.go @@ -36,6 +36,7 @@ var ( test = flag.BoolP("test", "t", false, "set this flag to generate the client code for the testdata") inputVersions = flag.StringSlice("input", []string{ "api/", + "admissionregistration/", "authentication/", "authorization/", "autoscaling/", diff --git a/hack/lib/init.sh b/hack/lib/init.sh index c3fc455581d..2f6a59201c4 100644 --- a/hack/lib/init.sh +++ b/hack/lib/init.sh @@ -52,6 +52,7 @@ KUBE_OUTPUT_HOSTBIN="${KUBE_OUTPUT_BINPATH}/$(kube::util::host_platform)" # most preferred version for a group should appear first KUBE_AVAILABLE_GROUP_VERSIONS="${KUBE_AVAILABLE_GROUP_VERSIONS:-\ v1 \ +admissionregistration.k8s.io/v1alpha1 \ apps/v1beta1 \ authentication.k8s.io/v1 \ authentication.k8s.io/v1beta1 \ diff --git a/pkg/apis/admissionregistration/types.go b/pkg/apis/admissionregistration/types.go index f10b51c8ac4..037c0757709 100644 --- a/pkg/apis/admissionregistration/types.go +++ b/pkg/apis/admissionregistration/types.go @@ -20,6 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +genclient=true + // InitializerConfiguration describes the configuration of initializers. type InitializerConfiguration struct { metav1.TypeMeta @@ -111,6 +113,8 @@ const ( Fail FailurePolicyType = "Fail" ) +// +genclient=true + // ExternalAdmissionHookConfiguration describes the configuration of initializers. type ExternalAdmissionHookConfiguration struct { metav1.TypeMeta diff --git a/pkg/apis/admissionregistration/v1alpha1/types.go b/pkg/apis/admissionregistration/v1alpha1/types.go index 206038313be..67a76dff981 100644 --- a/pkg/apis/admissionregistration/v1alpha1/types.go +++ b/pkg/apis/admissionregistration/v1alpha1/types.go @@ -20,6 +20,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// +genclient=true + // InitializerConfiguration describes the configuration of initializers. type InitializerConfiguration struct { metav1.TypeMeta `json:",inline"` @@ -113,6 +115,8 @@ const ( Fail FailurePolicyType = "Fail" ) +// +genclient=true + // ExternalAdmissionHookConfiguration describes the configuration of initializers. type ExternalAdmissionHookConfiguration struct { metav1.TypeMeta `json:",inline"` diff --git a/pkg/client/clientset_generated/clientset/clientset.go b/pkg/client/clientset_generated/clientset/clientset.go index 88df7ab770d..8d2d0758055 100644 --- a/pkg/client/clientset_generated/clientset/clientset.go +++ b/pkg/client/clientset_generated/clientset/clientset.go @@ -21,6 +21,7 @@ import ( discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" + admissionregistrationv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1" appsv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1" authenticationv1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authentication/v1" authenticationv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authentication/v1beta1" @@ -43,6 +44,9 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface + // Deprecated: please explicitly pick a version if possible. + Admissionregistration() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface CoreV1() corev1.CoreV1Interface // Deprecated: please explicitly pick a version if possible. Core() corev1.CoreV1Interface @@ -91,6 +95,7 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient + *admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Client *corev1.CoreV1Client *appsv1beta1.AppsV1beta1Client *authenticationv1.AuthenticationV1Client @@ -111,6 +116,23 @@ type Clientset struct { *storagev1.StorageV1Client } +// AdmissionregistrationV1alpha1 retrieves the AdmissionregistrationV1alpha1Client +func (c *Clientset) AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { + if c == nil { + return nil + } + return c.AdmissionregistrationV1alpha1Client +} + +// Deprecated: Admissionregistration retrieves the default version of AdmissionregistrationClient. +// Please explicitly pick a version. +func (c *Clientset) Admissionregistration() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { + if c == nil { + return nil + } + return c.AdmissionregistrationV1alpha1Client +} + // CoreV1 retrieves the CoreV1Client func (c *Clientset) CoreV1() corev1.CoreV1Interface { if c == nil { @@ -379,6 +401,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error + cs.AdmissionregistrationV1alpha1Client, err = admissionregistrationv1alpha1.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.CoreV1Client, err = corev1.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -464,6 +490,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset + cs.AdmissionregistrationV1alpha1Client = admissionregistrationv1alpha1.NewForConfigOrDie(c) cs.CoreV1Client = corev1.NewForConfigOrDie(c) cs.AppsV1beta1Client = appsv1beta1.NewForConfigOrDie(c) cs.AuthenticationV1Client = authenticationv1.NewForConfigOrDie(c) @@ -490,6 +517,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.AdmissionregistrationV1alpha1Client = admissionregistrationv1alpha1.New(c) cs.CoreV1Client = corev1.New(c) cs.AppsV1beta1Client = appsv1beta1.New(c) cs.AuthenticationV1Client = authenticationv1.New(c) diff --git a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go index 0e2a2ee2e01..dd769c6bad4 100644 --- a/pkg/client/clientset_generated/clientset/fake/clientset_generated.go +++ b/pkg/client/clientset_generated/clientset/fake/clientset_generated.go @@ -23,6 +23,8 @@ import ( fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" + admissionregistrationv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1" + fakeadmissionregistrationv1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake" appsv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1" fakeappsv1beta1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1/fake" authenticationv1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/authentication/v1" @@ -94,6 +96,16 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} +// AdmissionregistrationV1alpha1 retrieves the AdmissionregistrationV1alpha1Client +func (c *Clientset) AdmissionregistrationV1alpha1() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { + return &fakeadmissionregistrationv1alpha1.FakeAdmissionregistrationV1alpha1{Fake: &c.Fake} +} + +// Admissionregistration retrieves the AdmissionregistrationV1alpha1Client +func (c *Clientset) Admissionregistration() admissionregistrationv1alpha1.AdmissionregistrationV1alpha1Interface { + return &fakeadmissionregistrationv1alpha1.FakeAdmissionregistrationV1alpha1{Fake: &c.Fake} +} + // CoreV1 retrieves the CoreV1Client func (c *Clientset) CoreV1() corev1.CoreV1Interface { return &fakecorev1.FakeCoreV1{Fake: &c.Fake} diff --git a/pkg/client/clientset_generated/clientset/fake/register.go b/pkg/client/clientset_generated/clientset/fake/register.go index ef472db7739..f141949c0d7 100644 --- a/pkg/client/clientset_generated/clientset/fake/register.go +++ b/pkg/client/clientset_generated/clientset/fake/register.go @@ -22,6 +22,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" corev1 "k8s.io/kubernetes/pkg/api/v1" + admissionregistrationv1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" appsv1beta1 "k8s.io/kubernetes/pkg/apis/apps/v1beta1" authenticationv1 "k8s.io/kubernetes/pkg/apis/authentication/v1" authenticationv1beta1 "k8s.io/kubernetes/pkg/apis/authentication/v1beta1" @@ -65,6 +66,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { + admissionregistrationv1alpha1.AddToScheme(scheme) corev1.AddToScheme(scheme) appsv1beta1.AddToScheme(scheme) authenticationv1.AddToScheme(scheme) diff --git a/pkg/client/clientset_generated/clientset/scheme/register.go b/pkg/client/clientset_generated/clientset/scheme/register.go index 813426e9152..e59fb3ed596 100644 --- a/pkg/client/clientset_generated/clientset/scheme/register.go +++ b/pkg/client/clientset_generated/clientset/scheme/register.go @@ -22,6 +22,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" corev1 "k8s.io/kubernetes/pkg/api/v1" + admissionregistrationv1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" appsv1beta1 "k8s.io/kubernetes/pkg/apis/apps/v1beta1" authenticationv1 "k8s.io/kubernetes/pkg/apis/authentication/v1" authenticationv1beta1 "k8s.io/kubernetes/pkg/apis/authentication/v1beta1" @@ -65,6 +66,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { + admissionregistrationv1alpha1.AddToScheme(scheme) corev1.AddToScheme(scheme) appsv1beta1.AddToScheme(scheme) authenticationv1.AddToScheme(scheme) diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/admissionregistration_client.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/admissionregistration_client.go new file mode 100644 index 00000000000..688e9b68dca --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/admissionregistration_client.go @@ -0,0 +1,93 @@ +/* +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 ( + serializer "k8s.io/apimachinery/pkg/runtime/serializer" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" + "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme" +) + +type AdmissionregistrationV1alpha1Interface interface { + RESTClient() rest.Interface + ExternalAdmissionHookConfigurationsGetter + InitializerConfigurationsGetter +} + +// AdmissionregistrationV1alpha1Client is used to interact with features provided by the admissionregistration.k8s.io group. +type AdmissionregistrationV1alpha1Client struct { + restClient rest.Interface +} + +func (c *AdmissionregistrationV1alpha1Client) ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationInterface { + return newExternalAdmissionHookConfigurations(c, namespace) +} + +func (c *AdmissionregistrationV1alpha1Client) InitializerConfigurations(namespace string) InitializerConfigurationInterface { + return newInitializerConfigurations(c, namespace) +} + +// NewForConfig creates a new AdmissionregistrationV1alpha1Client for the given config. +func NewForConfig(c *rest.Config) (*AdmissionregistrationV1alpha1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AdmissionregistrationV1alpha1Client{client}, nil +} + +// NewForConfigOrDie creates a new AdmissionregistrationV1alpha1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationV1alpha1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AdmissionregistrationV1alpha1Client for the given RESTClient. +func New(c rest.Interface) *AdmissionregistrationV1alpha1Client { + return &AdmissionregistrationV1alpha1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha1.SchemeGroupVersion + config.GroupVersion = &gv + config.APIPath = "/apis" + config.NegotiatedSerializer = serializer.DirectCodecFactory{CodecFactory: scheme.Codecs} + + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AdmissionregistrationV1alpha1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/doc.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/doc.go new file mode 100644 index 00000000000..ba8d10d3b66 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/doc.go @@ -0,0 +1,20 @@ +/* +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 package is generated by client-gen with custom arguments. + +// This package has the automatically generated typed clients. +package v1alpha1 diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..bb70893e283 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go @@ -0,0 +1,155 @@ +/* +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 ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" + scheme "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme" +) + +// ExternalAdmissionHookConfigurationsGetter has a method to return a ExternalAdmissionHookConfigurationInterface. +// A group's client should implement this interface. +type ExternalAdmissionHookConfigurationsGetter interface { + ExternalAdmissionHookConfigurations(namespace string) 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 + ns string +} + +// newExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurations +func newExternalAdmissionHookConfigurations(c *AdmissionregistrationV1alpha1Client, namespace string) *externalAdmissionHookConfigurations { + return &externalAdmissionHookConfigurations{ + client: c.RESTClient(), + ns: namespace, + } +} + +// 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + Resource("externaladmissionhookconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + Resource("externaladmissionhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// 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). + Namespace(c.ns). + Resource("externaladmissionhookconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/doc.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/doc.go new file mode 100644 index 00000000000..c6548330a0d --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/doc.go @@ -0,0 +1,20 @@ +/* +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 package is generated by client-gen with custom arguments. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go new file mode 100644 index 00000000000..7e9fb050ab4 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_admissionregistration_client.go @@ -0,0 +1,42 @@ +/* +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 ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + v1alpha1 "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1" +) + +type FakeAdmissionregistrationV1alpha1 struct { + *testing.Fake +} + +func (c *FakeAdmissionregistrationV1alpha1) ExternalAdmissionHookConfigurations(namespace string) v1alpha1.ExternalAdmissionHookConfigurationInterface { + return &FakeExternalAdmissionHookConfigurations{c, namespace} +} + +func (c *FakeAdmissionregistrationV1alpha1) InitializerConfigurations(namespace string) v1alpha1.InitializerConfigurationInterface { + return &FakeInitializerConfigurations{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAdmissionregistrationV1alpha1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..39c8fc091ed --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_externaladmissionhookconfiguration.go @@ -0,0 +1,120 @@ +/* +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 ( + 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" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" +) + +// FakeExternalAdmissionHookConfigurations implements ExternalAdmissionHookConfigurationInterface +type FakeExternalAdmissionHookConfigurations struct { + Fake *FakeAdmissionregistrationV1alpha1 + ns string +} + +var externaladmissionhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "externaladmissionhookconfigurations"} + +var externaladmissionhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "ExternalAdmissionHookConfiguration"} + +func (c *FakeExternalAdmissionHookConfigurations) Create(externalAdmissionHookConfiguration *v1alpha1.ExternalAdmissionHookConfiguration) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(externaladmissionhookconfigurationsResource, c.ns, externalAdmissionHookConfiguration), &v1alpha1.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err +} + +func (c *FakeExternalAdmissionHookConfigurations) Update(externalAdmissionHookConfiguration *v1alpha1.ExternalAdmissionHookConfiguration) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(externaladmissionhookconfigurationsResource, c.ns, externalAdmissionHookConfiguration), &v1alpha1.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err +} + +func (c *FakeExternalAdmissionHookConfigurations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(externaladmissionhookconfigurationsResource, c.ns, name), &v1alpha1.ExternalAdmissionHookConfiguration{}) + + return err +} + +func (c *FakeExternalAdmissionHookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(externaladmissionhookconfigurationsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.ExternalAdmissionHookConfigurationList{}) + return err +} + +func (c *FakeExternalAdmissionHookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(externaladmissionhookconfigurationsResource, c.ns, name), &v1alpha1.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err +} + +func (c *FakeExternalAdmissionHookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.ExternalAdmissionHookConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(externaladmissionhookconfigurationsResource, externaladmissionhookconfigurationsKind, c.ns, 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.NewWatchAction(externaladmissionhookconfigurationsResource, c.ns, opts)) + +} + +// 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.NewPatchSubresourceAction(externaladmissionhookconfigurationsResource, c.ns, name, data, subresources...), &v1alpha1.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ExternalAdmissionHookConfiguration), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go new file mode 100644 index 00000000000..e047683ecc4 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/fake/fake_initializerconfiguration.go @@ -0,0 +1,120 @@ +/* +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 ( + 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" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" +) + +// FakeInitializerConfigurations implements InitializerConfigurationInterface +type FakeInitializerConfigurations struct { + Fake *FakeAdmissionregistrationV1alpha1 + ns string +} + +var initializerconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "initializerconfigurations"} + +var initializerconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "InitializerConfiguration"} + +func (c *FakeInitializerConfigurations) Create(initializerConfiguration *v1alpha1.InitializerConfiguration) (result *v1alpha1.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(initializerconfigurationsResource, c.ns, initializerConfiguration), &v1alpha1.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InitializerConfiguration), err +} + +func (c *FakeInitializerConfigurations) Update(initializerConfiguration *v1alpha1.InitializerConfiguration) (result *v1alpha1.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(initializerconfigurationsResource, c.ns, initializerConfiguration), &v1alpha1.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InitializerConfiguration), err +} + +func (c *FakeInitializerConfigurations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(initializerconfigurationsResource, c.ns, name), &v1alpha1.InitializerConfiguration{}) + + return err +} + +func (c *FakeInitializerConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(initializerconfigurationsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha1.InitializerConfigurationList{}) + return err +} + +func (c *FakeInitializerConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(initializerconfigurationsResource, c.ns, name), &v1alpha1.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InitializerConfiguration), err +} + +func (c *FakeInitializerConfigurations) List(opts v1.ListOptions) (result *v1alpha1.InitializerConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(initializerconfigurationsResource, initializerconfigurationsKind, c.ns, opts), &v1alpha1.InitializerConfigurationList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.InitializerConfigurationList{} + for _, item := range obj.(*v1alpha1.InitializerConfigurationList).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 initializerConfigurations. +func (c *FakeInitializerConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(initializerconfigurationsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched initializerConfiguration. +func (c *FakeInitializerConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(initializerconfigurationsResource, c.ns, name, data, subresources...), &v1alpha1.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.InitializerConfiguration), err +} diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/generated_expansion.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/generated_expansion.go new file mode 100644 index 00000000000..eef439ab472 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +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 + +type ExternalAdmissionHookConfigurationExpansion interface{} + +type InitializerConfigurationExpansion interface{} diff --git a/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/initializerconfiguration.go b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/initializerconfiguration.go new file mode 100644 index 00000000000..0452150d493 --- /dev/null +++ b/pkg/client/clientset_generated/clientset/typed/admissionregistration/v1alpha1/initializerconfiguration.go @@ -0,0 +1,155 @@ +/* +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 ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" + scheme "k8s.io/kubernetes/pkg/client/clientset_generated/clientset/scheme" +) + +// InitializerConfigurationsGetter has a method to return a InitializerConfigurationInterface. +// A group's client should implement this interface. +type InitializerConfigurationsGetter interface { + InitializerConfigurations(namespace string) InitializerConfigurationInterface +} + +// InitializerConfigurationInterface has methods to work with InitializerConfiguration resources. +type InitializerConfigurationInterface interface { + Create(*v1alpha1.InitializerConfiguration) (*v1alpha1.InitializerConfiguration, error) + Update(*v1alpha1.InitializerConfiguration) (*v1alpha1.InitializerConfiguration, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha1.InitializerConfiguration, error) + List(opts v1.ListOptions) (*v1alpha1.InitializerConfigurationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InitializerConfiguration, err error) + InitializerConfigurationExpansion +} + +// initializerConfigurations implements InitializerConfigurationInterface +type initializerConfigurations struct { + client rest.Interface + ns string +} + +// newInitializerConfigurations returns a InitializerConfigurations +func newInitializerConfigurations(c *AdmissionregistrationV1alpha1Client, namespace string) *initializerConfigurations { + return &initializerConfigurations{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a initializerConfiguration and creates it. Returns the server's representation of the initializerConfiguration, and an error, if there is any. +func (c *initializerConfigurations) Create(initializerConfiguration *v1alpha1.InitializerConfiguration) (result *v1alpha1.InitializerConfiguration, err error) { + result = &v1alpha1.InitializerConfiguration{} + err = c.client.Post(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Body(initializerConfiguration). + Do(). + Into(result) + return +} + +// Update takes the representation of a initializerConfiguration and updates it. Returns the server's representation of the initializerConfiguration, and an error, if there is any. +func (c *initializerConfigurations) Update(initializerConfiguration *v1alpha1.InitializerConfiguration) (result *v1alpha1.InitializerConfiguration, err error) { + result = &v1alpha1.InitializerConfiguration{} + err = c.client.Put(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Name(initializerConfiguration.Name). + Body(initializerConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the initializerConfiguration and deletes it. Returns an error if one occurs. +func (c *initializerConfigurations) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *initializerConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("initializerconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the initializerConfiguration, and returns the corresponding initializerConfiguration object, and an error if there is any. +func (c *initializerConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.InitializerConfiguration, err error) { + result = &v1alpha1.InitializerConfiguration{} + err = c.client.Get(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of InitializerConfigurations that match those selectors. +func (c *initializerConfigurations) List(opts v1.ListOptions) (result *v1alpha1.InitializerConfigurationList, err error) { + result = &v1alpha1.InitializerConfigurationList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("initializerconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested initializerConfigurations. +func (c *initializerConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("initializerconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched initializerConfiguration. +func (c *initializerConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.InitializerConfiguration, err error) { + result = &v1alpha1.InitializerConfiguration{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("initializerconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/clientset.go b/pkg/client/clientset_generated/internalclientset/clientset.go index 406531c16bc..7c7ab91c449 100644 --- a/pkg/client/clientset_generated/internalclientset/clientset.go +++ b/pkg/client/clientset_generated/internalclientset/clientset.go @@ -21,6 +21,7 @@ import ( discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" + admissionregistrationinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion" appsinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion" authenticationinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/internalversion" authorizationinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authorization/internalversion" @@ -37,6 +38,7 @@ import ( type Interface interface { Discovery() discovery.DiscoveryInterface + Admissionregistration() admissionregistrationinternalversion.AdmissionregistrationInterface Core() coreinternalversion.CoreInterface Apps() appsinternalversion.AppsInterface Authentication() authenticationinternalversion.AuthenticationInterface @@ -55,6 +57,7 @@ type Interface interface { // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient + *admissionregistrationinternalversion.AdmissionregistrationClient *coreinternalversion.CoreClient *appsinternalversion.AppsClient *authenticationinternalversion.AuthenticationClient @@ -69,6 +72,14 @@ type Clientset struct { *storageinternalversion.StorageClient } +// Admissionregistration retrieves the AdmissionregistrationClient +func (c *Clientset) Admissionregistration() admissionregistrationinternalversion.AdmissionregistrationInterface { + if c == nil { + return nil + } + return c.AdmissionregistrationClient +} + // Core retrieves the CoreClient func (c *Clientset) Core() coreinternalversion.CoreInterface { if c == nil { @@ -181,6 +192,10 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error + cs.AdmissionregistrationClient, err = admissionregistrationinternalversion.NewForConfig(&configShallowCopy) + if err != nil { + return nil, err + } cs.CoreClient, err = coreinternalversion.NewForConfig(&configShallowCopy) if err != nil { return nil, err @@ -242,6 +257,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset + cs.AdmissionregistrationClient = admissionregistrationinternalversion.NewForConfigOrDie(c) cs.CoreClient = coreinternalversion.NewForConfigOrDie(c) cs.AppsClient = appsinternalversion.NewForConfigOrDie(c) cs.AuthenticationClient = authenticationinternalversion.NewForConfigOrDie(c) @@ -262,6 +278,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset + cs.AdmissionregistrationClient = admissionregistrationinternalversion.New(c) cs.CoreClient = coreinternalversion.New(c) cs.AppsClient = appsinternalversion.New(c) cs.AuthenticationClient = authenticationinternalversion.New(c) diff --git a/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go b/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go index 5ae8510411a..a38a9806a26 100644 --- a/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go +++ b/pkg/client/clientset_generated/internalclientset/fake/clientset_generated.go @@ -23,6 +23,8 @@ import ( fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + admissionregistrationinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion" + fakeadmissionregistrationinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake" appsinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion" fakeappsinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/apps/internalversion/fake" authenticationinternalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/authentication/internalversion" @@ -82,6 +84,11 @@ func (c *Clientset) Discovery() discovery.DiscoveryInterface { var _ clientset.Interface = &Clientset{} +// Admissionregistration retrieves the AdmissionregistrationClient +func (c *Clientset) Admissionregistration() admissionregistrationinternalversion.AdmissionregistrationInterface { + return &fakeadmissionregistrationinternalversion.FakeAdmissionregistration{Fake: &c.Fake} +} + // Core retrieves the CoreClient func (c *Clientset) Core() coreinternalversion.CoreInterface { return &fakecoreinternalversion.FakeCore{Fake: &c.Fake} diff --git a/pkg/client/clientset_generated/internalclientset/fake/register.go b/pkg/client/clientset_generated/internalclientset/fake/register.go index d418245c49f..2ed0a2c0f33 100644 --- a/pkg/client/clientset_generated/internalclientset/fake/register.go +++ b/pkg/client/clientset_generated/internalclientset/fake/register.go @@ -22,6 +22,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" coreinternalversion "k8s.io/kubernetes/pkg/api" + admissionregistrationinternalversion "k8s.io/kubernetes/pkg/apis/admissionregistration" appsinternalversion "k8s.io/kubernetes/pkg/apis/apps" authenticationinternalversion "k8s.io/kubernetes/pkg/apis/authentication" authorizationinternalversion "k8s.io/kubernetes/pkg/apis/authorization" @@ -59,6 +60,7 @@ func init() { // After this, RawExtensions in Kubernetes types will serialize kube-aggregator types // correctly. func AddToScheme(scheme *runtime.Scheme) { + admissionregistrationinternalversion.AddToScheme(scheme) coreinternalversion.AddToScheme(scheme) appsinternalversion.AddToScheme(scheme) authenticationinternalversion.AddToScheme(scheme) diff --git a/pkg/client/clientset_generated/internalclientset/scheme/register.go b/pkg/client/clientset_generated/internalclientset/scheme/register.go index e524195a5db..726182e800d 100644 --- a/pkg/client/clientset_generated/internalclientset/scheme/register.go +++ b/pkg/client/clientset_generated/internalclientset/scheme/register.go @@ -24,6 +24,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" serializer "k8s.io/apimachinery/pkg/runtime/serializer" core "k8s.io/kubernetes/pkg/api/install" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration/install" apps "k8s.io/kubernetes/pkg/apis/apps/install" authentication "k8s.io/kubernetes/pkg/apis/authentication/install" authorization "k8s.io/kubernetes/pkg/apis/authorization/install" @@ -52,6 +53,7 @@ func init() { // Install registers the API group and adds types to a scheme func Install(groupFactoryRegistry announced.APIGroupFactoryRegistry, registry *registered.APIRegistrationManager, scheme *runtime.Scheme) { + admissionregistration.Install(groupFactoryRegistry, registry, scheme) core.Install(groupFactoryRegistry, registry, scheme) apps.Install(groupFactoryRegistry, registry, scheme) authentication.Install(groupFactoryRegistry, registry, scheme) diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/admissionregistration_client.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/admissionregistration_client.go new file mode 100644 index 00000000000..a6e023ef163 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/admissionregistration_client.go @@ -0,0 +1,104 @@ +/* +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 internalversion + +import ( + rest "k8s.io/client-go/rest" + "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" +) + +type AdmissionregistrationInterface interface { + RESTClient() rest.Interface + ExternalAdmissionHookConfigurationsGetter + InitializerConfigurationsGetter +} + +// AdmissionregistrationClient is used to interact with features provided by the admissionregistration.k8s.io group. +type AdmissionregistrationClient struct { + restClient rest.Interface +} + +func (c *AdmissionregistrationClient) ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationInterface { + return newExternalAdmissionHookConfigurations(c, namespace) +} + +func (c *AdmissionregistrationClient) InitializerConfigurations(namespace string) InitializerConfigurationInterface { + return newInitializerConfigurations(c, namespace) +} + +// NewForConfig creates a new AdmissionregistrationClient for the given config. +func NewForConfig(c *rest.Config) (*AdmissionregistrationClient, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientFor(&config) + if err != nil { + return nil, err + } + return &AdmissionregistrationClient{client}, nil +} + +// NewForConfigOrDie creates a new AdmissionregistrationClient for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *AdmissionregistrationClient { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new AdmissionregistrationClient for the given RESTClient. +func New(c rest.Interface) *AdmissionregistrationClient { + return &AdmissionregistrationClient{c} +} + +func setConfigDefaults(config *rest.Config) error { + g, err := scheme.Registry.Group("admissionregistration.k8s.io") + if err != nil { + return err + } + + config.APIPath = "/apis" + if config.UserAgent == "" { + config.UserAgent = rest.DefaultKubernetesUserAgent() + } + if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group { + gv := g.GroupVersion + config.GroupVersion = &gv + } + config.NegotiatedSerializer = scheme.Codecs + + if config.QPS == 0 { + config.QPS = 5 + } + if config.Burst == 0 { + config.Burst = 10 + } + + return nil +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *AdmissionregistrationClient) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/doc.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/doc.go new file mode 100644 index 00000000000..0a27970fbb3 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/doc.go @@ -0,0 +1,20 @@ +/* +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 package is generated by client-gen with the default arguments. + +// This package has the automatically generated typed clients. +package internalversion diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/externaladmissionhookconfiguration.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..1d81625c6d2 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/externaladmissionhookconfiguration.go @@ -0,0 +1,155 @@ +/* +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 internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" + scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" +) + +// ExternalAdmissionHookConfigurationsGetter has a method to return a ExternalAdmissionHookConfigurationInterface. +// A group's client should implement this interface. +type ExternalAdmissionHookConfigurationsGetter interface { + ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationInterface +} + +// ExternalAdmissionHookConfigurationInterface has methods to work with ExternalAdmissionHookConfiguration resources. +type ExternalAdmissionHookConfigurationInterface interface { + Create(*admissionregistration.ExternalAdmissionHookConfiguration) (*admissionregistration.ExternalAdmissionHookConfiguration, error) + Update(*admissionregistration.ExternalAdmissionHookConfiguration) (*admissionregistration.ExternalAdmissionHookConfiguration, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*admissionregistration.ExternalAdmissionHookConfiguration, error) + List(opts v1.ListOptions) (*admissionregistration.ExternalAdmissionHookConfigurationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) + ExternalAdmissionHookConfigurationExpansion +} + +// externalAdmissionHookConfigurations implements ExternalAdmissionHookConfigurationInterface +type externalAdmissionHookConfigurations struct { + client rest.Interface + ns string +} + +// newExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurations +func newExternalAdmissionHookConfigurations(c *AdmissionregistrationClient, namespace string) *externalAdmissionHookConfigurations { + return &externalAdmissionHookConfigurations{ + client: c.RESTClient(), + ns: namespace, + } +} + +// 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 *admissionregistration.ExternalAdmissionHookConfiguration) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + result = &admissionregistration.ExternalAdmissionHookConfiguration{} + err = c.client.Post(). + Namespace(c.ns). + 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 *admissionregistration.ExternalAdmissionHookConfiguration) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + result = &admissionregistration.ExternalAdmissionHookConfiguration{} + err = c.client.Put(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + Resource("externaladmissionhookconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// 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 *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + result = &admissionregistration.ExternalAdmissionHookConfiguration{} + err = c.client.Get(). + Namespace(c.ns). + 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 *admissionregistration.ExternalAdmissionHookConfigurationList, err error) { + result = &admissionregistration.ExternalAdmissionHookConfigurationList{} + err = c.client.Get(). + Namespace(c.ns). + 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(). + Namespace(c.ns). + Resource("externaladmissionhookconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched externalAdmissionHookConfiguration. +func (c *externalAdmissionHookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + result = &admissionregistration.ExternalAdmissionHookConfiguration{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("externaladmissionhookconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/doc.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/doc.go new file mode 100644 index 00000000000..a0ecb96ba17 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/doc.go @@ -0,0 +1,20 @@ +/* +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 package is generated by client-gen with the default arguments. + +// Package fake has the automatically generated clients. +package fake diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_admissionregistration_client.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_admissionregistration_client.go new file mode 100644 index 00000000000..b375ff9e7d1 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_admissionregistration_client.go @@ -0,0 +1,42 @@ +/* +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 ( + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" + internalversion "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion" +) + +type FakeAdmissionregistration struct { + *testing.Fake +} + +func (c *FakeAdmissionregistration) ExternalAdmissionHookConfigurations(namespace string) internalversion.ExternalAdmissionHookConfigurationInterface { + return &FakeExternalAdmissionHookConfigurations{c, namespace} +} + +func (c *FakeAdmissionregistration) InitializerConfigurations(namespace string) internalversion.InitializerConfigurationInterface { + return &FakeInitializerConfigurations{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeAdmissionregistration) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_externaladmissionhookconfiguration.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..299972a068a --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_externaladmissionhookconfiguration.go @@ -0,0 +1,120 @@ +/* +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 ( + 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" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" +) + +// FakeExternalAdmissionHookConfigurations implements ExternalAdmissionHookConfigurationInterface +type FakeExternalAdmissionHookConfigurations struct { + Fake *FakeAdmissionregistration + ns string +} + +var externaladmissionhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "", Resource: "externaladmissionhookconfigurations"} + +var externaladmissionhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "", Kind: "ExternalAdmissionHookConfiguration"} + +func (c *FakeExternalAdmissionHookConfigurations) Create(externalAdmissionHookConfiguration *admissionregistration.ExternalAdmissionHookConfiguration) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(externaladmissionhookconfigurationsResource, c.ns, externalAdmissionHookConfiguration), &admissionregistration.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.ExternalAdmissionHookConfiguration), err +} + +func (c *FakeExternalAdmissionHookConfigurations) Update(externalAdmissionHookConfiguration *admissionregistration.ExternalAdmissionHookConfiguration) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(externaladmissionhookconfigurationsResource, c.ns, externalAdmissionHookConfiguration), &admissionregistration.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.ExternalAdmissionHookConfiguration), err +} + +func (c *FakeExternalAdmissionHookConfigurations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(externaladmissionhookconfigurationsResource, c.ns, name), &admissionregistration.ExternalAdmissionHookConfiguration{}) + + return err +} + +func (c *FakeExternalAdmissionHookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(externaladmissionhookconfigurationsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &admissionregistration.ExternalAdmissionHookConfigurationList{}) + return err +} + +func (c *FakeExternalAdmissionHookConfigurations) Get(name string, options v1.GetOptions) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(externaladmissionhookconfigurationsResource, c.ns, name), &admissionregistration.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.ExternalAdmissionHookConfiguration), err +} + +func (c *FakeExternalAdmissionHookConfigurations) List(opts v1.ListOptions) (result *admissionregistration.ExternalAdmissionHookConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(externaladmissionhookconfigurationsResource, externaladmissionhookconfigurationsKind, c.ns, opts), &admissionregistration.ExternalAdmissionHookConfigurationList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &admissionregistration.ExternalAdmissionHookConfigurationList{} + for _, item := range obj.(*admissionregistration.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.NewWatchAction(externaladmissionhookconfigurationsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched externalAdmissionHookConfiguration. +func (c *FakeExternalAdmissionHookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistration.ExternalAdmissionHookConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(externaladmissionhookconfigurationsResource, c.ns, name, data, subresources...), &admissionregistration.ExternalAdmissionHookConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.ExternalAdmissionHookConfiguration), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_initializerconfiguration.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_initializerconfiguration.go new file mode 100644 index 00000000000..72f39df33e1 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/fake/fake_initializerconfiguration.go @@ -0,0 +1,120 @@ +/* +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 ( + 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" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" +) + +// FakeInitializerConfigurations implements InitializerConfigurationInterface +type FakeInitializerConfigurations struct { + Fake *FakeAdmissionregistration + ns string +} + +var initializerconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "", Resource: "initializerconfigurations"} + +var initializerconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "", Kind: "InitializerConfiguration"} + +func (c *FakeInitializerConfigurations) Create(initializerConfiguration *admissionregistration.InitializerConfiguration) (result *admissionregistration.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(initializerconfigurationsResource, c.ns, initializerConfiguration), &admissionregistration.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.InitializerConfiguration), err +} + +func (c *FakeInitializerConfigurations) Update(initializerConfiguration *admissionregistration.InitializerConfiguration) (result *admissionregistration.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(initializerconfigurationsResource, c.ns, initializerConfiguration), &admissionregistration.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.InitializerConfiguration), err +} + +func (c *FakeInitializerConfigurations) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(initializerconfigurationsResource, c.ns, name), &admissionregistration.InitializerConfiguration{}) + + return err +} + +func (c *FakeInitializerConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(initializerconfigurationsResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &admissionregistration.InitializerConfigurationList{}) + return err +} + +func (c *FakeInitializerConfigurations) Get(name string, options v1.GetOptions) (result *admissionregistration.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(initializerconfigurationsResource, c.ns, name), &admissionregistration.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.InitializerConfiguration), err +} + +func (c *FakeInitializerConfigurations) List(opts v1.ListOptions) (result *admissionregistration.InitializerConfigurationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(initializerconfigurationsResource, initializerconfigurationsKind, c.ns, opts), &admissionregistration.InitializerConfigurationList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &admissionregistration.InitializerConfigurationList{} + for _, item := range obj.(*admissionregistration.InitializerConfigurationList).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 initializerConfigurations. +func (c *FakeInitializerConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(initializerconfigurationsResource, c.ns, opts)) + +} + +// Patch applies the patch and returns the patched initializerConfiguration. +func (c *FakeInitializerConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistration.InitializerConfiguration, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(initializerconfigurationsResource, c.ns, name, data, subresources...), &admissionregistration.InitializerConfiguration{}) + + if obj == nil { + return nil, err + } + return obj.(*admissionregistration.InitializerConfiguration), err +} diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/generated_expansion.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/generated_expansion.go new file mode 100644 index 00000000000..631817dea3f --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/generated_expansion.go @@ -0,0 +1,21 @@ +/* +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 internalversion + +type ExternalAdmissionHookConfigurationExpansion interface{} + +type InitializerConfigurationExpansion interface{} diff --git a/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/initializerconfiguration.go b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/initializerconfiguration.go new file mode 100644 index 00000000000..bcb4a8bb4b4 --- /dev/null +++ b/pkg/client/clientset_generated/internalclientset/typed/admissionregistration/internalversion/initializerconfiguration.go @@ -0,0 +1,155 @@ +/* +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 internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" + scheme "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset/scheme" +) + +// InitializerConfigurationsGetter has a method to return a InitializerConfigurationInterface. +// A group's client should implement this interface. +type InitializerConfigurationsGetter interface { + InitializerConfigurations(namespace string) InitializerConfigurationInterface +} + +// InitializerConfigurationInterface has methods to work with InitializerConfiguration resources. +type InitializerConfigurationInterface interface { + Create(*admissionregistration.InitializerConfiguration) (*admissionregistration.InitializerConfiguration, error) + Update(*admissionregistration.InitializerConfiguration) (*admissionregistration.InitializerConfiguration, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*admissionregistration.InitializerConfiguration, error) + List(opts v1.ListOptions) (*admissionregistration.InitializerConfigurationList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistration.InitializerConfiguration, err error) + InitializerConfigurationExpansion +} + +// initializerConfigurations implements InitializerConfigurationInterface +type initializerConfigurations struct { + client rest.Interface + ns string +} + +// newInitializerConfigurations returns a InitializerConfigurations +func newInitializerConfigurations(c *AdmissionregistrationClient, namespace string) *initializerConfigurations { + return &initializerConfigurations{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Create takes the representation of a initializerConfiguration and creates it. Returns the server's representation of the initializerConfiguration, and an error, if there is any. +func (c *initializerConfigurations) Create(initializerConfiguration *admissionregistration.InitializerConfiguration) (result *admissionregistration.InitializerConfiguration, err error) { + result = &admissionregistration.InitializerConfiguration{} + err = c.client.Post(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Body(initializerConfiguration). + Do(). + Into(result) + return +} + +// Update takes the representation of a initializerConfiguration and updates it. Returns the server's representation of the initializerConfiguration, and an error, if there is any. +func (c *initializerConfigurations) Update(initializerConfiguration *admissionregistration.InitializerConfiguration) (result *admissionregistration.InitializerConfiguration, err error) { + result = &admissionregistration.InitializerConfiguration{} + err = c.client.Put(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Name(initializerConfiguration.Name). + Body(initializerConfiguration). + Do(). + Into(result) + return +} + +// Delete takes name of the initializerConfiguration and deletes it. Returns an error if one occurs. +func (c *initializerConfigurations) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *initializerConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("initializerconfigurations"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Body(options). + Do(). + Error() +} + +// Get takes name of the initializerConfiguration, and returns the corresponding initializerConfiguration object, and an error if there is any. +func (c *initializerConfigurations) Get(name string, options v1.GetOptions) (result *admissionregistration.InitializerConfiguration, err error) { + result = &admissionregistration.InitializerConfiguration{} + err = c.client.Get(). + Namespace(c.ns). + Resource("initializerconfigurations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of InitializerConfigurations that match those selectors. +func (c *initializerConfigurations) List(opts v1.ListOptions) (result *admissionregistration.InitializerConfigurationList, err error) { + result = &admissionregistration.InitializerConfigurationList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("initializerconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested initializerConfigurations. +func (c *initializerConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) { + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("initializerconfigurations"). + VersionedParams(&opts, scheme.ParameterCodec). + Watch() +} + +// Patch applies the patch and returns the patched initializerConfiguration. +func (c *initializerConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *admissionregistration.InitializerConfiguration, err error) { + result = &admissionregistration.InitializerConfiguration{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("initializerconfigurations"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/informers/informers_generated/externalversions/admissionregistration/interface.go b/pkg/client/informers/informers_generated/externalversions/admissionregistration/interface.go new file mode 100644 index 00000000000..d5e2faea682 --- /dev/null +++ b/pkg/client/informers/informers_generated/externalversions/admissionregistration/interface.go @@ -0,0 +1,44 @@ +/* +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 admissionregistration + +import ( + v1alpha1 "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1" + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // V1alpha1 provides access to shared informers for resources in V1alpha1. + V1alpha1() v1alpha1.Interface +} + +type group struct { + internalinterfaces.SharedInformerFactory +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory) Interface { + return &group{f} +} + +// V1alpha1 returns a new v1alpha1.Interface. +func (g *group) V1alpha1() v1alpha1.Interface { + return v1alpha1.New(g.SharedInformerFactory) +} diff --git a/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go b/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..94231ed14c8 --- /dev/null +++ b/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go @@ -0,0 +1,68 @@ +/* +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 ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + admissionregistration_v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces" + v1alpha1 "k8s.io/kubernetes/pkg/client/listers/admissionregistration/v1alpha1" + 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 +} + +func newExternalAdmissionHookConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + sharedIndexInformer := cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + return client.AdmissionregistrationV1alpha1().ExternalAdmissionHookConfigurations(v1.NamespaceAll).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + return client.AdmissionregistrationV1alpha1().ExternalAdmissionHookConfigurations(v1.NamespaceAll).Watch(options) + }, + }, + &admissionregistration_v1alpha1.ExternalAdmissionHookConfiguration{}, + resyncPeriod, + cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + ) + + return sharedIndexInformer +} + +func (f *externalAdmissionHookConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistration_v1alpha1.ExternalAdmissionHookConfiguration{}, newExternalAdmissionHookConfigurationInformer) +} + +func (f *externalAdmissionHookConfigurationInformer) Lister() v1alpha1.ExternalAdmissionHookConfigurationLister { + return v1alpha1.NewExternalAdmissionHookConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/initializerconfiguration.go b/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/initializerconfiguration.go new file mode 100644 index 00000000000..343b66980ed --- /dev/null +++ b/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/initializerconfiguration.go @@ -0,0 +1,68 @@ +/* +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 ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + admissionregistration_v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" + clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces" + v1alpha1 "k8s.io/kubernetes/pkg/client/listers/admissionregistration/v1alpha1" + time "time" +) + +// InitializerConfigurationInformer provides access to a shared informer and lister for +// InitializerConfigurations. +type InitializerConfigurationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.InitializerConfigurationLister +} + +type initializerConfigurationInformer struct { + factory internalinterfaces.SharedInformerFactory +} + +func newInitializerConfigurationInformer(client clientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + sharedIndexInformer := cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + return client.AdmissionregistrationV1alpha1().InitializerConfigurations(v1.NamespaceAll).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + return client.AdmissionregistrationV1alpha1().InitializerConfigurations(v1.NamespaceAll).Watch(options) + }, + }, + &admissionregistration_v1alpha1.InitializerConfiguration{}, + resyncPeriod, + cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + ) + + return sharedIndexInformer +} + +func (f *initializerConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistration_v1alpha1.InitializerConfiguration{}, newInitializerConfigurationInformer) +} + +func (f *initializerConfigurationInformer) Lister() v1alpha1.InitializerConfigurationLister { + return v1alpha1.NewInitializerConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/interface.go b/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/interface.go new file mode 100644 index 00000000000..51f83597475 --- /dev/null +++ b/pkg/client/informers/informers_generated/externalversions/admissionregistration/v1alpha1/interface.go @@ -0,0 +1,50 @@ +/* +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 ( + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/internalinterfaces" +) + +// 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 +} + +type version struct { + internalinterfaces.SharedInformerFactory +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory) Interface { + return &version{f} +} + +// ExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurationInformer. +func (v *version) ExternalAdmissionHookConfigurations() ExternalAdmissionHookConfigurationInformer { + return &externalAdmissionHookConfigurationInformer{factory: v.SharedInformerFactory} +} + +// InitializerConfigurations returns a InitializerConfigurationInformer. +func (v *version) InitializerConfigurations() InitializerConfigurationInformer { + return &initializerConfigurationInformer{factory: v.SharedInformerFactory} +} diff --git a/pkg/client/informers/informers_generated/externalversions/factory.go b/pkg/client/informers/informers_generated/externalversions/factory.go index 913335df07d..4510ad1a81b 100644 --- a/pkg/client/informers/informers_generated/externalversions/factory.go +++ b/pkg/client/informers/informers_generated/externalversions/factory.go @@ -23,6 +23,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" + admissionregistration "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/admissionregistration" apps "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/apps" autoscaling "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/autoscaling" batch "k8s.io/kubernetes/pkg/client/informers/informers_generated/externalversions/batch" @@ -119,6 +120,7 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + Admissionregistration() admissionregistration.Interface Apps() apps.Interface Autoscaling() autoscaling.Interface Batch() batch.Interface @@ -131,6 +133,10 @@ type SharedInformerFactory interface { Storage() storage.Interface } +func (f *sharedInformerFactory) Admissionregistration() admissionregistration.Interface { + return admissionregistration.New(f) +} + func (f *sharedInformerFactory) Apps() apps.Interface { return apps.New(f) } diff --git a/pkg/client/informers/informers_generated/externalversions/generic.go b/pkg/client/informers/informers_generated/externalversions/generic.go index 6b7a96078a8..1103769cc90 100644 --- a/pkg/client/informers/informers_generated/externalversions/generic.go +++ b/pkg/client/informers/informers_generated/externalversions/generic.go @@ -23,6 +23,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" api_v1 "k8s.io/kubernetes/pkg/api/v1" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" v1beta1 "k8s.io/kubernetes/pkg/apis/apps/v1beta1" v1 "k8s.io/kubernetes/pkg/apis/autoscaling/v1" v2alpha1 "k8s.io/kubernetes/pkg/apis/autoscaling/v2alpha1" @@ -31,7 +32,7 @@ import ( certificates_v1beta1 "k8s.io/kubernetes/pkg/apis/certificates/v1beta1" extensions_v1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1" policy_v1beta1 "k8s.io/kubernetes/pkg/apis/policy/v1beta1" - v1alpha1 "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1" + rbac_v1alpha1 "k8s.io/kubernetes/pkg/apis/rbac/v1alpha1" rbac_v1beta1 "k8s.io/kubernetes/pkg/apis/rbac/v1beta1" settings_v1alpha1 "k8s.io/kubernetes/pkg/apis/settings/v1alpha1" storage_v1 "k8s.io/kubernetes/pkg/apis/storage/v1" @@ -64,7 +65,13 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=Apps, Version=V1beta1 + // Group=Admissionregistration, 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 + + // Group=Apps, Version=V1beta1 case v1beta1.SchemeGroupVersion.WithResource("controllerrevisions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().V1beta1().ControllerRevisions().Informer()}, nil case v1beta1.SchemeGroupVersion.WithResource("deployments"): @@ -145,13 +152,13 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource return &genericInformer{resource: resource.GroupResource(), informer: f.Policy().V1beta1().PodDisruptionBudgets().Informer()}, nil // Group=Rbac, Version=V1alpha1 - case v1alpha1.SchemeGroupVersion.WithResource("clusterroles"): + case rbac_v1alpha1.SchemeGroupVersion.WithResource("clusterroles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ClusterRoles().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("clusterrolebindings"): + case rbac_v1alpha1.SchemeGroupVersion.WithResource("clusterrolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().ClusterRoleBindings().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("roles"): + case rbac_v1alpha1.SchemeGroupVersion.WithResource("roles"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().Roles().Informer()}, nil - case v1alpha1.SchemeGroupVersion.WithResource("rolebindings"): + case rbac_v1alpha1.SchemeGroupVersion.WithResource("rolebindings"): return &genericInformer{resource: resource.GroupResource(), informer: f.Rbac().V1alpha1().RoleBindings().Informer()}, nil // Group=Rbac, Version=V1beta1 diff --git a/pkg/client/informers/informers_generated/internalversion/admissionregistration/interface.go b/pkg/client/informers/informers_generated/internalversion/admissionregistration/interface.go new file mode 100644 index 00000000000..036ae9754b6 --- /dev/null +++ b/pkg/client/informers/informers_generated/internalversion/admissionregistration/interface.go @@ -0,0 +1,44 @@ +/* +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 admissionregistration + +import ( + internalversion "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion" + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" +) + +// Interface provides access to each of this group's versions. +type Interface interface { + // InternalVersion provides access to shared informers for resources in InternalVersion. + InternalVersion() internalversion.Interface +} + +type group struct { + internalinterfaces.SharedInformerFactory +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory) Interface { + return &group{f} +} + +// InternalVersion returns a new internalversion.Interface. +func (g *group) InternalVersion() internalversion.Interface { + return internalversion.New(g.SharedInformerFactory) +} diff --git a/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/externaladmissionhookconfiguration.go b/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..1d703db10be --- /dev/null +++ b/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/externaladmissionhookconfiguration.go @@ -0,0 +1,68 @@ +/* +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 internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" + internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" + internalversion "k8s.io/kubernetes/pkg/client/listers/admissionregistration/internalversion" + time "time" +) + +// ExternalAdmissionHookConfigurationInformer provides access to a shared informer and lister for +// ExternalAdmissionHookConfigurations. +type ExternalAdmissionHookConfigurationInformer interface { + Informer() cache.SharedIndexInformer + Lister() internalversion.ExternalAdmissionHookConfigurationLister +} + +type externalAdmissionHookConfigurationInformer struct { + factory internalinterfaces.SharedInformerFactory +} + +func newExternalAdmissionHookConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + sharedIndexInformer := cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + return client.Admissionregistration().ExternalAdmissionHookConfigurations(v1.NamespaceAll).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + return client.Admissionregistration().ExternalAdmissionHookConfigurations(v1.NamespaceAll).Watch(options) + }, + }, + &admissionregistration.ExternalAdmissionHookConfiguration{}, + resyncPeriod, + cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + ) + + return sharedIndexInformer +} + +func (f *externalAdmissionHookConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistration.ExternalAdmissionHookConfiguration{}, newExternalAdmissionHookConfigurationInformer) +} + +func (f *externalAdmissionHookConfigurationInformer) Lister() internalversion.ExternalAdmissionHookConfigurationLister { + return internalversion.NewExternalAdmissionHookConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/initializerconfiguration.go b/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/initializerconfiguration.go new file mode 100644 index 00000000000..ecff18037d1 --- /dev/null +++ b/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/initializerconfiguration.go @@ -0,0 +1,68 @@ +/* +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 internalversion + +import ( + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" + internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" + internalversion "k8s.io/kubernetes/pkg/client/listers/admissionregistration/internalversion" + time "time" +) + +// InitializerConfigurationInformer provides access to a shared informer and lister for +// InitializerConfigurations. +type InitializerConfigurationInformer interface { + Informer() cache.SharedIndexInformer + Lister() internalversion.InitializerConfigurationLister +} + +type initializerConfigurationInformer struct { + factory internalinterfaces.SharedInformerFactory +} + +func newInitializerConfigurationInformer(client internalclientset.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + sharedIndexInformer := cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + return client.Admissionregistration().InitializerConfigurations(v1.NamespaceAll).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + return client.Admissionregistration().InitializerConfigurations(v1.NamespaceAll).Watch(options) + }, + }, + &admissionregistration.InitializerConfiguration{}, + resyncPeriod, + cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, + ) + + return sharedIndexInformer +} + +func (f *initializerConfigurationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&admissionregistration.InitializerConfiguration{}, newInitializerConfigurationInformer) +} + +func (f *initializerConfigurationInformer) Lister() internalversion.InitializerConfigurationLister { + return internalversion.NewInitializerConfigurationLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/interface.go b/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/interface.go new file mode 100644 index 00000000000..bd0803e2759 --- /dev/null +++ b/pkg/client/informers/informers_generated/internalversion/admissionregistration/internalversion/interface.go @@ -0,0 +1,50 @@ +/* +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 internalversion + +import ( + internalinterfaces "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/internalinterfaces" +) + +// 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 +} + +type version struct { + internalinterfaces.SharedInformerFactory +} + +// New returns a new Interface. +func New(f internalinterfaces.SharedInformerFactory) Interface { + return &version{f} +} + +// ExternalAdmissionHookConfigurations returns a ExternalAdmissionHookConfigurationInformer. +func (v *version) ExternalAdmissionHookConfigurations() ExternalAdmissionHookConfigurationInformer { + return &externalAdmissionHookConfigurationInformer{factory: v.SharedInformerFactory} +} + +// InitializerConfigurations returns a InitializerConfigurationInformer. +func (v *version) InitializerConfigurations() InitializerConfigurationInformer { + return &initializerConfigurationInformer{factory: v.SharedInformerFactory} +} diff --git a/pkg/client/informers/informers_generated/internalversion/factory.go b/pkg/client/informers/informers_generated/internalversion/factory.go index b7613c1d211..6d9870602ff 100644 --- a/pkg/client/informers/informers_generated/internalversion/factory.go +++ b/pkg/client/informers/informers_generated/internalversion/factory.go @@ -23,6 +23,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" internalclientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" + admissionregistration "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/admissionregistration" apps "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/apps" autoscaling "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/autoscaling" batch "k8s.io/kubernetes/pkg/client/informers/informers_generated/internalversion/batch" @@ -119,6 +120,7 @@ type SharedInformerFactory interface { ForResource(resource schema.GroupVersionResource) (GenericInformer, error) WaitForCacheSync(stopCh <-chan struct{}) map[reflect.Type]bool + Admissionregistration() admissionregistration.Interface Apps() apps.Interface Autoscaling() autoscaling.Interface Batch() batch.Interface @@ -131,6 +133,10 @@ type SharedInformerFactory interface { Storage() storage.Interface } +func (f *sharedInformerFactory) Admissionregistration() admissionregistration.Interface { + return admissionregistration.New(f) +} + func (f *sharedInformerFactory) Apps() apps.Interface { return apps.New(f) } diff --git a/pkg/client/informers/informers_generated/internalversion/generic.go b/pkg/client/informers/informers_generated/internalversion/generic.go index 66fc08d1ff1..0939ff17a78 100644 --- a/pkg/client/informers/informers_generated/internalversion/generic.go +++ b/pkg/client/informers/informers_generated/internalversion/generic.go @@ -23,6 +23,7 @@ import ( schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" api "k8s.io/kubernetes/pkg/api" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" apps "k8s.io/kubernetes/pkg/apis/apps" autoscaling "k8s.io/kubernetes/pkg/apis/autoscaling" batch "k8s.io/kubernetes/pkg/apis/batch" @@ -60,7 +61,13 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=Apps, Version=InternalVersion + // Group=Admissionregistration, Version=InternalVersion + case admissionregistration.SchemeGroupVersion.WithResource("externaladmissionhookconfigurations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().InternalVersion().ExternalAdmissionHookConfigurations().Informer()}, nil + case admissionregistration.SchemeGroupVersion.WithResource("initializerconfigurations"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().InternalVersion().InitializerConfigurations().Informer()}, nil + + // Group=Apps, Version=InternalVersion case apps.SchemeGroupVersion.WithResource("controllerrevisions"): return &genericInformer{resource: resource.GroupResource(), informer: f.Apps().InternalVersion().ControllerRevisions().Informer()}, nil case apps.SchemeGroupVersion.WithResource("statefulsets"): diff --git a/pkg/client/listers/admissionregistration/internalversion/expansion_generated.go b/pkg/client/listers/admissionregistration/internalversion/expansion_generated.go new file mode 100644 index 00000000000..1312196a181 --- /dev/null +++ b/pkg/client/listers/admissionregistration/internalversion/expansion_generated.go @@ -0,0 +1,35 @@ +/* +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 internalversion + +// ExternalAdmissionHookConfigurationListerExpansion allows custom methods to be added to +// ExternalAdmissionHookConfigurationLister. +type ExternalAdmissionHookConfigurationListerExpansion interface{} + +// ExternalAdmissionHookConfigurationNamespaceListerExpansion allows custom methods to be added to +// ExternalAdmissionHookConfigurationNamespaceLister. +type ExternalAdmissionHookConfigurationNamespaceListerExpansion interface{} + +// InitializerConfigurationListerExpansion allows custom methods to be added to +// InitializerConfigurationLister. +type InitializerConfigurationListerExpansion interface{} + +// InitializerConfigurationNamespaceListerExpansion allows custom methods to be added to +// InitializerConfigurationNamespaceLister. +type InitializerConfigurationNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/admissionregistration/internalversion/externaladmissionhookconfiguration.go b/pkg/client/listers/admissionregistration/internalversion/externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..5faafe8cc80 --- /dev/null +++ b/pkg/client/listers/admissionregistration/internalversion/externaladmissionhookconfiguration.go @@ -0,0 +1,94 @@ +/* +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 internalversion + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" +) + +// ExternalAdmissionHookConfigurationLister helps list ExternalAdmissionHookConfigurations. +type ExternalAdmissionHookConfigurationLister interface { + // List lists all ExternalAdmissionHookConfigurations in the indexer. + List(selector labels.Selector) (ret []*admissionregistration.ExternalAdmissionHookConfiguration, err error) + // ExternalAdmissionHookConfigurations returns an object that can list and get ExternalAdmissionHookConfigurations. + ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationNamespaceLister + 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 []*admissionregistration.ExternalAdmissionHookConfiguration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*admissionregistration.ExternalAdmissionHookConfiguration)) + }) + return ret, err +} + +// ExternalAdmissionHookConfigurations returns an object that can list and get ExternalAdmissionHookConfigurations. +func (s *externalAdmissionHookConfigurationLister) ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationNamespaceLister { + return externalAdmissionHookConfigurationNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ExternalAdmissionHookConfigurationNamespaceLister helps list and get ExternalAdmissionHookConfigurations. +type ExternalAdmissionHookConfigurationNamespaceLister interface { + // List lists all ExternalAdmissionHookConfigurations in the indexer for a given namespace. + List(selector labels.Selector) (ret []*admissionregistration.ExternalAdmissionHookConfiguration, err error) + // Get retrieves the ExternalAdmissionHookConfiguration from the indexer for a given namespace and name. + Get(name string) (*admissionregistration.ExternalAdmissionHookConfiguration, error) + ExternalAdmissionHookConfigurationNamespaceListerExpansion +} + +// externalAdmissionHookConfigurationNamespaceLister implements the ExternalAdmissionHookConfigurationNamespaceLister +// interface. +type externalAdmissionHookConfigurationNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ExternalAdmissionHookConfigurations in the indexer for a given namespace. +func (s externalAdmissionHookConfigurationNamespaceLister) List(selector labels.Selector) (ret []*admissionregistration.ExternalAdmissionHookConfiguration, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*admissionregistration.ExternalAdmissionHookConfiguration)) + }) + return ret, err +} + +// Get retrieves the ExternalAdmissionHookConfiguration from the indexer for a given namespace and name. +func (s externalAdmissionHookConfigurationNamespaceLister) Get(name string) (*admissionregistration.ExternalAdmissionHookConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(admissionregistration.Resource("externaladmissionhookconfiguration"), name) + } + return obj.(*admissionregistration.ExternalAdmissionHookConfiguration), nil +} diff --git a/pkg/client/listers/admissionregistration/internalversion/initializerconfiguration.go b/pkg/client/listers/admissionregistration/internalversion/initializerconfiguration.go new file mode 100644 index 00000000000..3f9a3ccf308 --- /dev/null +++ b/pkg/client/listers/admissionregistration/internalversion/initializerconfiguration.go @@ -0,0 +1,94 @@ +/* +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 internalversion + +import ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + admissionregistration "k8s.io/kubernetes/pkg/apis/admissionregistration" +) + +// InitializerConfigurationLister helps list InitializerConfigurations. +type InitializerConfigurationLister interface { + // List lists all InitializerConfigurations in the indexer. + List(selector labels.Selector) (ret []*admissionregistration.InitializerConfiguration, err error) + // InitializerConfigurations returns an object that can list and get InitializerConfigurations. + InitializerConfigurations(namespace string) InitializerConfigurationNamespaceLister + InitializerConfigurationListerExpansion +} + +// initializerConfigurationLister implements the InitializerConfigurationLister interface. +type initializerConfigurationLister struct { + indexer cache.Indexer +} + +// NewInitializerConfigurationLister returns a new InitializerConfigurationLister. +func NewInitializerConfigurationLister(indexer cache.Indexer) InitializerConfigurationLister { + return &initializerConfigurationLister{indexer: indexer} +} + +// List lists all InitializerConfigurations in the indexer. +func (s *initializerConfigurationLister) List(selector labels.Selector) (ret []*admissionregistration.InitializerConfiguration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*admissionregistration.InitializerConfiguration)) + }) + return ret, err +} + +// InitializerConfigurations returns an object that can list and get InitializerConfigurations. +func (s *initializerConfigurationLister) InitializerConfigurations(namespace string) InitializerConfigurationNamespaceLister { + return initializerConfigurationNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// InitializerConfigurationNamespaceLister helps list and get InitializerConfigurations. +type InitializerConfigurationNamespaceLister interface { + // List lists all InitializerConfigurations in the indexer for a given namespace. + List(selector labels.Selector) (ret []*admissionregistration.InitializerConfiguration, err error) + // Get retrieves the InitializerConfiguration from the indexer for a given namespace and name. + Get(name string) (*admissionregistration.InitializerConfiguration, error) + InitializerConfigurationNamespaceListerExpansion +} + +// initializerConfigurationNamespaceLister implements the InitializerConfigurationNamespaceLister +// interface. +type initializerConfigurationNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all InitializerConfigurations in the indexer for a given namespace. +func (s initializerConfigurationNamespaceLister) List(selector labels.Selector) (ret []*admissionregistration.InitializerConfiguration, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*admissionregistration.InitializerConfiguration)) + }) + return ret, err +} + +// Get retrieves the InitializerConfiguration from the indexer for a given namespace and name. +func (s initializerConfigurationNamespaceLister) Get(name string) (*admissionregistration.InitializerConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(admissionregistration.Resource("initializerconfiguration"), name) + } + return obj.(*admissionregistration.InitializerConfiguration), nil +} diff --git a/pkg/client/listers/admissionregistration/v1alpha1/expansion_generated.go b/pkg/client/listers/admissionregistration/v1alpha1/expansion_generated.go new file mode 100644 index 00000000000..3282a8bcfeb --- /dev/null +++ b/pkg/client/listers/admissionregistration/v1alpha1/expansion_generated.go @@ -0,0 +1,35 @@ +/* +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 + +// ExternalAdmissionHookConfigurationListerExpansion allows custom methods to be added to +// ExternalAdmissionHookConfigurationLister. +type ExternalAdmissionHookConfigurationListerExpansion interface{} + +// ExternalAdmissionHookConfigurationNamespaceListerExpansion allows custom methods to be added to +// ExternalAdmissionHookConfigurationNamespaceLister. +type ExternalAdmissionHookConfigurationNamespaceListerExpansion interface{} + +// InitializerConfigurationListerExpansion allows custom methods to be added to +// InitializerConfigurationLister. +type InitializerConfigurationListerExpansion interface{} + +// InitializerConfigurationNamespaceListerExpansion allows custom methods to be added to +// InitializerConfigurationNamespaceLister. +type InitializerConfigurationNamespaceListerExpansion interface{} diff --git a/pkg/client/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go b/pkg/client/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go new file mode 100644 index 00000000000..e594077be5d --- /dev/null +++ b/pkg/client/listers/admissionregistration/v1alpha1/externaladmissionhookconfiguration.go @@ -0,0 +1,94 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" +) + +// ExternalAdmissionHookConfigurationLister helps list ExternalAdmissionHookConfigurations. +type ExternalAdmissionHookConfigurationLister interface { + // List lists all ExternalAdmissionHookConfigurations in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.ExternalAdmissionHookConfiguration, err error) + // ExternalAdmissionHookConfigurations returns an object that can list and get ExternalAdmissionHookConfigurations. + ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationNamespaceLister + 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 +} + +// ExternalAdmissionHookConfigurations returns an object that can list and get ExternalAdmissionHookConfigurations. +func (s *externalAdmissionHookConfigurationLister) ExternalAdmissionHookConfigurations(namespace string) ExternalAdmissionHookConfigurationNamespaceLister { + return externalAdmissionHookConfigurationNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// ExternalAdmissionHookConfigurationNamespaceLister helps list and get ExternalAdmissionHookConfigurations. +type ExternalAdmissionHookConfigurationNamespaceLister interface { + // List lists all ExternalAdmissionHookConfigurations in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.ExternalAdmissionHookConfiguration, err error) + // Get retrieves the ExternalAdmissionHookConfiguration from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.ExternalAdmissionHookConfiguration, error) + ExternalAdmissionHookConfigurationNamespaceListerExpansion +} + +// externalAdmissionHookConfigurationNamespaceLister implements the ExternalAdmissionHookConfigurationNamespaceLister +// interface. +type externalAdmissionHookConfigurationNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all ExternalAdmissionHookConfigurations in the indexer for a given namespace. +func (s externalAdmissionHookConfigurationNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.ExternalAdmissionHookConfiguration, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ExternalAdmissionHookConfiguration)) + }) + return ret, err +} + +// Get retrieves the ExternalAdmissionHookConfiguration from the indexer for a given namespace and name. +func (s externalAdmissionHookConfigurationNamespaceLister) Get(name string) (*v1alpha1.ExternalAdmissionHookConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + 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/pkg/client/listers/admissionregistration/v1alpha1/initializerconfiguration.go b/pkg/client/listers/admissionregistration/v1alpha1/initializerconfiguration.go new file mode 100644 index 00000000000..3387032c7f9 --- /dev/null +++ b/pkg/client/listers/admissionregistration/v1alpha1/initializerconfiguration.go @@ -0,0 +1,94 @@ +/* +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 ( + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" + v1alpha1 "k8s.io/kubernetes/pkg/apis/admissionregistration/v1alpha1" +) + +// InitializerConfigurationLister helps list InitializerConfigurations. +type InitializerConfigurationLister interface { + // List lists all InitializerConfigurations in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.InitializerConfiguration, err error) + // InitializerConfigurations returns an object that can list and get InitializerConfigurations. + InitializerConfigurations(namespace string) InitializerConfigurationNamespaceLister + InitializerConfigurationListerExpansion +} + +// initializerConfigurationLister implements the InitializerConfigurationLister interface. +type initializerConfigurationLister struct { + indexer cache.Indexer +} + +// NewInitializerConfigurationLister returns a new InitializerConfigurationLister. +func NewInitializerConfigurationLister(indexer cache.Indexer) InitializerConfigurationLister { + return &initializerConfigurationLister{indexer: indexer} +} + +// List lists all InitializerConfigurations in the indexer. +func (s *initializerConfigurationLister) List(selector labels.Selector) (ret []*v1alpha1.InitializerConfiguration, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.InitializerConfiguration)) + }) + return ret, err +} + +// InitializerConfigurations returns an object that can list and get InitializerConfigurations. +func (s *initializerConfigurationLister) InitializerConfigurations(namespace string) InitializerConfigurationNamespaceLister { + return initializerConfigurationNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// InitializerConfigurationNamespaceLister helps list and get InitializerConfigurations. +type InitializerConfigurationNamespaceLister interface { + // List lists all InitializerConfigurations in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha1.InitializerConfiguration, err error) + // Get retrieves the InitializerConfiguration from the indexer for a given namespace and name. + Get(name string) (*v1alpha1.InitializerConfiguration, error) + InitializerConfigurationNamespaceListerExpansion +} + +// initializerConfigurationNamespaceLister implements the InitializerConfigurationNamespaceLister +// interface. +type initializerConfigurationNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all InitializerConfigurations in the indexer for a given namespace. +func (s initializerConfigurationNamespaceLister) List(selector labels.Selector) (ret []*v1alpha1.InitializerConfiguration, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.InitializerConfiguration)) + }) + return ret, err +} + +// Get retrieves the InitializerConfiguration from the indexer for a given namespace and name. +func (s initializerConfigurationNamespaceLister) Get(name string) (*v1alpha1.InitializerConfiguration, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("initializerconfiguration"), name) + } + return obj.(*v1alpha1.InitializerConfiguration), nil +}