Skip to content

Commit

Permalink
Update generated files for MutatingWebhookConfiguration
Browse files Browse the repository at this point in the history
Kubernetes-commit: 4568e0530c53df81d1bbd5e700daca041a1d8439
  • Loading branch information
mbohlool authored and k8s-publish-robot committed Nov 8, 2017
1 parent 67de9e0 commit c32c36a
Show file tree
Hide file tree
Showing 14 changed files with 443 additions and 0 deletions.
1 change: 1 addition & 0 deletions informers/admissionregistration/v1alpha1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ go_library(
srcs = [
"initializerconfiguration.go",
"interface.go",
"mutatingwebhookconfiguration.go",
"validatingwebhookconfiguration.go",
],
importpath = "k8s.io/client-go/informers/admissionregistration/v1alpha1",
Expand Down
7 changes: 7 additions & 0 deletions informers/admissionregistration/v1alpha1/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import (
type Interface interface {
// InitializerConfigurations returns a InitializerConfigurationInformer.
InitializerConfigurations() InitializerConfigurationInformer
// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer
// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer.
ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer
}
Expand All @@ -46,6 +48,11 @@ func (v *version) InitializerConfigurations() InitializerConfigurationInformer {
return &initializerConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

// MutatingWebhookConfigurations returns a MutatingWebhookConfigurationInformer.
func (v *version) MutatingWebhookConfigurations() MutatingWebhookConfigurationInformer {
return &mutatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
}

// ValidatingWebhookConfigurations returns a ValidatingWebhookConfigurationInformer.
func (v *version) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInformer {
return &validatingWebhookConfigurationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

// This file was automatically generated by informer-gen

package v1alpha1

import (
admissionregistration_v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
watch "k8s.io/apimachinery/pkg/watch"
internalinterfaces "k8s.io/client-go/informers/internalinterfaces"
kubernetes "k8s.io/client-go/kubernetes"
v1alpha1 "k8s.io/client-go/listers/admissionregistration/v1alpha1"
cache "k8s.io/client-go/tools/cache"
time "time"
)

// MutatingWebhookConfigurationInformer provides access to a shared informer and lister for
// MutatingWebhookConfigurations.
type MutatingWebhookConfigurationInformer interface {
Informer() cache.SharedIndexInformer
Lister() v1alpha1.MutatingWebhookConfigurationLister
}

type mutatingWebhookConfigurationInformer struct {
factory internalinterfaces.SharedInformerFactory
tweakListOptions internalinterfaces.TweakListOptionsFunc
}

// NewMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer {
return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, indexers, nil)
}

// NewFilteredMutatingWebhookConfigurationInformer constructs a new informer for MutatingWebhookConfiguration type.
// Always prefer using an informer factory to get a shared informer instead of getting an independent
// one. This reduces memory footprint and number of connections to the server.
func NewFilteredMutatingWebhookConfigurationInformer(client kubernetes.Interface, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer {
return cache.NewSharedIndexInformer(
&cache.ListWatch{
ListFunc: func(options v1.ListOptions) (runtime.Object, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1alpha1().MutatingWebhookConfigurations().List(options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {
tweakListOptions(&options)
}
return client.AdmissionregistrationV1alpha1().MutatingWebhookConfigurations().Watch(options)
},
},
&admissionregistration_v1alpha1.MutatingWebhookConfiguration{},
resyncPeriod,
indexers,
)
}

func (f *mutatingWebhookConfigurationInformer) defaultInformer(client kubernetes.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer {
return NewFilteredMutatingWebhookConfigurationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions)
}

func (f *mutatingWebhookConfigurationInformer) Informer() cache.SharedIndexInformer {
return f.factory.InformerFor(&admissionregistration_v1alpha1.MutatingWebhookConfiguration{}, f.defaultInformer)
}

func (f *mutatingWebhookConfigurationInformer) Lister() v1alpha1.MutatingWebhookConfigurationLister {
return v1alpha1.NewMutatingWebhookConfigurationLister(f.Informer().GetIndexer())
}
2 changes: 2 additions & 0 deletions informers/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
// Group=admissionregistration.k8s.io, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("initializerconfigurations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().InitializerConfigurations().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("mutatingwebhookconfigurations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().MutatingWebhookConfigurations().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("validatingwebhookconfigurations"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Admissionregistration().V1alpha1().ValidatingWebhookConfigurations().Informer()}, nil

Expand Down
1 change: 1 addition & 0 deletions kubernetes/typed/admissionregistration/v1alpha1/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ go_library(
"doc.go",
"generated_expansion.go",
"initializerconfiguration.go",
"mutatingwebhookconfiguration.go",
"validatingwebhookconfiguration.go",
],
importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
type AdmissionregistrationV1alpha1Interface interface {
RESTClient() rest.Interface
InitializerConfigurationsGetter
MutatingWebhookConfigurationsGetter
ValidatingWebhookConfigurationsGetter
}

Expand All @@ -38,6 +39,10 @@ func (c *AdmissionregistrationV1alpha1Client) InitializerConfigurations() Initia
return newInitializerConfigurations(c)
}

func (c *AdmissionregistrationV1alpha1Client) MutatingWebhookConfigurations() MutatingWebhookConfigurationInterface {
return newMutatingWebhookConfigurations(c)
}

func (c *AdmissionregistrationV1alpha1Client) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationInterface {
return newValidatingWebhookConfigurations(c)
}
Expand Down
1 change: 1 addition & 0 deletions kubernetes/typed/admissionregistration/v1alpha1/fake/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ go_library(
"doc.go",
"fake_admissionregistration_client.go",
"fake_initializerconfiguration.go",
"fake_mutatingwebhookconfiguration.go",
"fake_validatingwebhookconfiguration.go",
],
importpath = "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1/fake",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func (c *FakeAdmissionregistrationV1alpha1) InitializerConfigurations() v1alpha1
return &FakeInitializerConfigurations{c}
}

func (c *FakeAdmissionregistrationV1alpha1) MutatingWebhookConfigurations() v1alpha1.MutatingWebhookConfigurationInterface {
return &FakeMutatingWebhookConfigurations{c}
}

func (c *FakeAdmissionregistrationV1alpha1) ValidatingWebhookConfigurations() v1alpha1.ValidatingWebhookConfigurationInterface {
return &FakeValidatingWebhookConfigurations{c}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package fake

import (
v1alpha1 "k8s.io/api/admissionregistration/v1alpha1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
labels "k8s.io/apimachinery/pkg/labels"
schema "k8s.io/apimachinery/pkg/runtime/schema"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
testing "k8s.io/client-go/testing"
)

// FakeMutatingWebhookConfigurations implements MutatingWebhookConfigurationInterface
type FakeMutatingWebhookConfigurations struct {
Fake *FakeAdmissionregistrationV1alpha1
}

var mutatingwebhookconfigurationsResource = schema.GroupVersionResource{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Resource: "mutatingwebhookconfigurations"}

var mutatingwebhookconfigurationsKind = schema.GroupVersionKind{Group: "admissionregistration.k8s.io", Version: "v1alpha1", Kind: "MutatingWebhookConfiguration"}

// Get takes name of the mutatingWebhookConfiguration, and returns the corresponding mutatingWebhookConfiguration object, and an error if there is any.
func (c *FakeMutatingWebhookConfigurations) Get(name string, options v1.GetOptions) (result *v1alpha1.MutatingWebhookConfiguration, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootGetAction(mutatingwebhookconfigurationsResource, name), &v1alpha1.MutatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.MutatingWebhookConfiguration), err
}

// List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors.
func (c *FakeMutatingWebhookConfigurations) List(opts v1.ListOptions) (result *v1alpha1.MutatingWebhookConfigurationList, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootListAction(mutatingwebhookconfigurationsResource, mutatingwebhookconfigurationsKind, opts), &v1alpha1.MutatingWebhookConfigurationList{})
if obj == nil {
return nil, err
}

label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1alpha1.MutatingWebhookConfigurationList{}
for _, item := range obj.(*v1alpha1.MutatingWebhookConfigurationList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}

// Watch returns a watch.Interface that watches the requested mutatingWebhookConfigurations.
func (c *FakeMutatingWebhookConfigurations) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewRootWatchAction(mutatingwebhookconfigurationsResource, opts))
}

// Create takes the representation of a mutatingWebhookConfiguration and creates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
func (c *FakeMutatingWebhookConfigurations) Create(mutatingWebhookConfiguration *v1alpha1.MutatingWebhookConfiguration) (result *v1alpha1.MutatingWebhookConfiguration, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootCreateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1alpha1.MutatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.MutatingWebhookConfiguration), err
}

// Update takes the representation of a mutatingWebhookConfiguration and updates it. Returns the server's representation of the mutatingWebhookConfiguration, and an error, if there is any.
func (c *FakeMutatingWebhookConfigurations) Update(mutatingWebhookConfiguration *v1alpha1.MutatingWebhookConfiguration) (result *v1alpha1.MutatingWebhookConfiguration, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootUpdateAction(mutatingwebhookconfigurationsResource, mutatingWebhookConfiguration), &v1alpha1.MutatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.MutatingWebhookConfiguration), err
}

// Delete takes name of the mutatingWebhookConfiguration and deletes it. Returns an error if one occurs.
func (c *FakeMutatingWebhookConfigurations) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewRootDeleteAction(mutatingwebhookconfigurationsResource, name), &v1alpha1.MutatingWebhookConfiguration{})
return err
}

// DeleteCollection deletes a collection of objects.
func (c *FakeMutatingWebhookConfigurations) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewRootDeleteCollectionAction(mutatingwebhookconfigurationsResource, listOptions)

_, err := c.Fake.Invokes(action, &v1alpha1.MutatingWebhookConfigurationList{})
return err
}

// Patch applies the patch and returns the patched mutatingWebhookConfiguration.
func (c *FakeMutatingWebhookConfigurations) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.MutatingWebhookConfiguration, err error) {
obj, err := c.Fake.
Invokes(testing.NewRootPatchSubresourceAction(mutatingwebhookconfigurationsResource, name, data, subresources...), &v1alpha1.MutatingWebhookConfiguration{})
if obj == nil {
return nil, err
}
return obj.(*v1alpha1.MutatingWebhookConfiguration), err
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ package v1alpha1

type InitializerConfigurationExpansion interface{}

type MutatingWebhookConfigurationExpansion interface{}

type ValidatingWebhookConfigurationExpansion interface{}
Loading

0 comments on commit c32c36a

Please sign in to comment.