diff --git a/CHANGELOG.md b/CHANGELOG.md index f04a4f82e7a..05b55da0470 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,7 +20,7 @@ - Can use Pod Identity with Azure Event Hub scaler ([#994](https://github.com/kedacore/keda/issues/994)) - Introducing InfluxDB scaler ([#1239](https://github.com/kedacore/keda/issues/1239)) - Add Redis cluster support for Redis list and Redis streams scalers ([#1437](https://github.com/kedacore/keda/pull/1437)) -- Global authentication credentials can be managed using ClusterTriggerAuthentication objects ([#1452](https://github.com/kedacore/keda/pull/1452)) +- Global authentication credentials can be managed using ClusterTriggerAuthentication objects ([#1452](https://github.com/kedacore/keda/pull/1452),[#1486](https://github.com/kedacore/keda/pull/1486)) ### Improvements - Support add ScaledJob's label to its job ([#1311](https://github.com/kedacore/keda/issues/1311)) diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/clustertriggerauthentication.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/clustertriggerauthentication.go new file mode 100644 index 00000000000..65540d074bf --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/clustertriggerauthentication.go @@ -0,0 +1,168 @@ +/* +Copyright 2020 The KEDA 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + "time" + + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + scheme "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned/scheme" + 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" +) + +// ClusterTriggerAuthenticationsGetter has a method to return a ClusterTriggerAuthenticationInterface. +// A group's client should implement this interface. +type ClusterTriggerAuthenticationsGetter interface { + ClusterTriggerAuthentications() ClusterTriggerAuthenticationInterface +} + +// ClusterTriggerAuthenticationInterface has methods to work with ClusterTriggerAuthentication resources. +type ClusterTriggerAuthenticationInterface interface { + Create(ctx context.Context, clusterTriggerAuthentication *v1alpha1.ClusterTriggerAuthentication, opts v1.CreateOptions) (*v1alpha1.ClusterTriggerAuthentication, error) + Update(ctx context.Context, clusterTriggerAuthentication *v1alpha1.ClusterTriggerAuthentication, opts v1.UpdateOptions) (*v1alpha1.ClusterTriggerAuthentication, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.ClusterTriggerAuthentication, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.ClusterTriggerAuthenticationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTriggerAuthentication, err error) + ClusterTriggerAuthenticationExpansion +} + +// clusterTriggerAuthentications implements ClusterTriggerAuthenticationInterface +type clusterTriggerAuthentications struct { + client rest.Interface +} + +// newClusterTriggerAuthentications returns a ClusterTriggerAuthentications +func newClusterTriggerAuthentications(c *KedaV1alpha1Client) *clusterTriggerAuthentications { + return &clusterTriggerAuthentications{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterTriggerAuthentication, and returns the corresponding clusterTriggerAuthentication object, and an error if there is any. +func (c *clusterTriggerAuthentications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + result = &v1alpha1.ClusterTriggerAuthentication{} + err = c.client.Get(). + Resource("clustertriggerauthentications"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTriggerAuthentications that match those selectors. +func (c *clusterTriggerAuthentications) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTriggerAuthenticationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha1.ClusterTriggerAuthenticationList{} + err = c.client.Get(). + Resource("clustertriggerauthentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTriggerAuthentications. +func (c *clusterTriggerAuthentications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Resource("clustertriggerauthentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTriggerAuthentication and creates it. Returns the server's representation of the clusterTriggerAuthentication, and an error, if there is any. +func (c *clusterTriggerAuthentications) Create(ctx context.Context, clusterTriggerAuthentication *v1alpha1.ClusterTriggerAuthentication, opts v1.CreateOptions) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + result = &v1alpha1.ClusterTriggerAuthentication{} + err = c.client.Post(). + Resource("clustertriggerauthentications"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTriggerAuthentication). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTriggerAuthentication and updates it. Returns the server's representation of the clusterTriggerAuthentication, and an error, if there is any. +func (c *clusterTriggerAuthentications) Update(ctx context.Context, clusterTriggerAuthentication *v1alpha1.ClusterTriggerAuthentication, opts v1.UpdateOptions) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + result = &v1alpha1.ClusterTriggerAuthentication{} + err = c.client.Put(). + Resource("clustertriggerauthentications"). + Name(clusterTriggerAuthentication.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTriggerAuthentication). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTriggerAuthentication and deletes it. Returns an error if one occurs. +func (c *clusterTriggerAuthentications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clustertriggerauthentications"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTriggerAuthentications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clustertriggerauthentications"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTriggerAuthentication. +func (c *clusterTriggerAuthentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + result = &v1alpha1.ClusterTriggerAuthentication{} + err = c.client.Patch(pt). + Resource("clustertriggerauthentications"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_clustertriggerauthentication.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_clustertriggerauthentication.go new file mode 100644 index 00000000000..cd1c63b47bc --- /dev/null +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_clustertriggerauthentication.go @@ -0,0 +1,122 @@ +/* +Copyright 2020 The KEDA 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + v1alpha1 "github.com/kedacore/keda/v2/api/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" +) + +// FakeClusterTriggerAuthentications implements ClusterTriggerAuthenticationInterface +type FakeClusterTriggerAuthentications struct { + Fake *FakeKedaV1alpha1 +} + +var clustertriggerauthenticationsResource = schema.GroupVersionResource{Group: "keda", Version: "v1alpha1", Resource: "clustertriggerauthentications"} + +var clustertriggerauthenticationsKind = schema.GroupVersionKind{Group: "keda", Version: "v1alpha1", Kind: "ClusterTriggerAuthentication"} + +// Get takes name of the clusterTriggerAuthentication, and returns the corresponding clusterTriggerAuthentication object, and an error if there is any. +func (c *FakeClusterTriggerAuthentications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustertriggerauthenticationsResource, name), &v1alpha1.ClusterTriggerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterTriggerAuthentication), err +} + +// List takes label and field selectors, and returns the list of ClusterTriggerAuthentications that match those selectors. +func (c *FakeClusterTriggerAuthentications) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.ClusterTriggerAuthenticationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustertriggerauthenticationsResource, clustertriggerauthenticationsKind, opts), &v1alpha1.ClusterTriggerAuthenticationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha1.ClusterTriggerAuthenticationList{ListMeta: obj.(*v1alpha1.ClusterTriggerAuthenticationList).ListMeta} + for _, item := range obj.(*v1alpha1.ClusterTriggerAuthenticationList).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 clusterTriggerAuthentications. +func (c *FakeClusterTriggerAuthentications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustertriggerauthenticationsResource, opts)) +} + +// Create takes the representation of a clusterTriggerAuthentication and creates it. Returns the server's representation of the clusterTriggerAuthentication, and an error, if there is any. +func (c *FakeClusterTriggerAuthentications) Create(ctx context.Context, clusterTriggerAuthentication *v1alpha1.ClusterTriggerAuthentication, opts v1.CreateOptions) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustertriggerauthenticationsResource, clusterTriggerAuthentication), &v1alpha1.ClusterTriggerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterTriggerAuthentication), err +} + +// Update takes the representation of a clusterTriggerAuthentication and updates it. Returns the server's representation of the clusterTriggerAuthentication, and an error, if there is any. +func (c *FakeClusterTriggerAuthentications) Update(ctx context.Context, clusterTriggerAuthentication *v1alpha1.ClusterTriggerAuthentication, opts v1.UpdateOptions) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustertriggerauthenticationsResource, clusterTriggerAuthentication), &v1alpha1.ClusterTriggerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterTriggerAuthentication), err +} + +// Delete takes name of the clusterTriggerAuthentication and deletes it. Returns an error if one occurs. +func (c *FakeClusterTriggerAuthentications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteAction(clustertriggerauthenticationsResource, name), &v1alpha1.ClusterTriggerAuthentication{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTriggerAuthentications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustertriggerauthenticationsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha1.ClusterTriggerAuthenticationList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTriggerAuthentication. +func (c *FakeClusterTriggerAuthentications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.ClusterTriggerAuthentication, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustertriggerauthenticationsResource, name, pt, data, subresources...), &v1alpha1.ClusterTriggerAuthentication{}) + if obj == nil { + return nil, err + } + return obj.(*v1alpha1.ClusterTriggerAuthentication), err +} diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go index d0a922524e1..3bab1ee1265 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/fake/fake_keda_client.go @@ -28,6 +28,10 @@ type FakeKedaV1alpha1 struct { *testing.Fake } +func (c *FakeKedaV1alpha1) ClusterTriggerAuthentications() v1alpha1.ClusterTriggerAuthenticationInterface { + return &FakeClusterTriggerAuthentications{c} +} + func (c *FakeKedaV1alpha1) ScaledJobs(namespace string) v1alpha1.ScaledJobInterface { return &FakeScaledJobs{c, namespace} } diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/generated_expansion.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/generated_expansion.go index 40cd687618a..a4c332fa93b 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/generated_expansion.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/generated_expansion.go @@ -18,6 +18,8 @@ limitations under the License. package v1alpha1 +type ClusterTriggerAuthenticationExpansion interface{} + type ScaledJobExpansion interface{} type ScaledObjectExpansion interface{} diff --git a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go index fa3b9067ade..e28df2cf01e 100644 --- a/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go +++ b/pkg/generated/clientset/versioned/typed/keda/v1alpha1/keda_client.go @@ -26,6 +26,7 @@ import ( type KedaV1alpha1Interface interface { RESTClient() rest.Interface + ClusterTriggerAuthenticationsGetter ScaledJobsGetter ScaledObjectsGetter TriggerAuthenticationsGetter @@ -36,6 +37,10 @@ type KedaV1alpha1Client struct { restClient rest.Interface } +func (c *KedaV1alpha1Client) ClusterTriggerAuthentications() ClusterTriggerAuthenticationInterface { + return newClusterTriggerAuthentications(c) +} + func (c *KedaV1alpha1Client) ScaledJobs(namespace string) ScaledJobInterface { return newScaledJobs(c, namespace) } diff --git a/pkg/generated/informers/externalversions/generic.go b/pkg/generated/informers/externalversions/generic.go index 7c3a21c19a3..f72986fb06d 100644 --- a/pkg/generated/informers/externalversions/generic.go +++ b/pkg/generated/informers/externalversions/generic.go @@ -53,6 +53,8 @@ func (f *genericInformer) Lister() cache.GenericLister { func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { // Group=keda, Version=v1alpha1 + case v1alpha1.SchemeGroupVersion.WithResource("clustertriggerauthentications"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Keda().V1alpha1().ClusterTriggerAuthentications().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("scaledjobs"): return &genericInformer{resource: resource.GroupResource(), informer: f.Keda().V1alpha1().ScaledJobs().Informer()}, nil case v1alpha1.SchemeGroupVersion.WithResource("scaledobjects"): diff --git a/pkg/generated/informers/externalversions/keda/v1alpha1/clustertriggerauthentication.go b/pkg/generated/informers/externalversions/keda/v1alpha1/clustertriggerauthentication.go new file mode 100644 index 00000000000..93e95c6cf44 --- /dev/null +++ b/pkg/generated/informers/externalversions/keda/v1alpha1/clustertriggerauthentication.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The KEDA 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. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + "context" + time "time" + + kedav1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + versioned "github.com/kedacore/keda/v2/pkg/generated/clientset/versioned" + internalinterfaces "github.com/kedacore/keda/v2/pkg/generated/informers/externalversions/internalinterfaces" + v1alpha1 "github.com/kedacore/keda/v2/pkg/generated/listers/keda/v1alpha1" + 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" +) + +// ClusterTriggerAuthenticationInformer provides access to a shared informer and lister for +// ClusterTriggerAuthentications. +type ClusterTriggerAuthenticationInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha1.ClusterTriggerAuthenticationLister +} + +type clusterTriggerAuthenticationInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc +} + +// NewClusterTriggerAuthenticationInformer constructs a new informer for ClusterTriggerAuthentication 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 NewClusterTriggerAuthenticationInformer(client versioned.Interface, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredClusterTriggerAuthenticationInformer(client, resyncPeriod, indexers, nil) +} + +// NewFilteredClusterTriggerAuthenticationInformer constructs a new informer for ClusterTriggerAuthentication 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 NewFilteredClusterTriggerAuthenticationInformer(client versioned.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.KedaV1alpha1().ClusterTriggerAuthentications().List(context.TODO(), options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.KedaV1alpha1().ClusterTriggerAuthentications().Watch(context.TODO(), options) + }, + }, + &kedav1alpha1.ClusterTriggerAuthentication{}, + resyncPeriod, + indexers, + ) +} + +func (f *clusterTriggerAuthenticationInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredClusterTriggerAuthenticationInformer(client, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *clusterTriggerAuthenticationInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&kedav1alpha1.ClusterTriggerAuthentication{}, f.defaultInformer) +} + +func (f *clusterTriggerAuthenticationInformer) Lister() v1alpha1.ClusterTriggerAuthenticationLister { + return v1alpha1.NewClusterTriggerAuthenticationLister(f.Informer().GetIndexer()) +} diff --git a/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go b/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go index 66502e45034..b5c202d57f2 100644 --- a/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go +++ b/pkg/generated/informers/externalversions/keda/v1alpha1/interface.go @@ -24,6 +24,8 @@ import ( // Interface provides access to all the informers in this group version. type Interface interface { + // ClusterTriggerAuthentications returns a ClusterTriggerAuthenticationInformer. + ClusterTriggerAuthentications() ClusterTriggerAuthenticationInformer // ScaledJobs returns a ScaledJobInformer. ScaledJobs() ScaledJobInformer // ScaledObjects returns a ScaledObjectInformer. @@ -43,6 +45,11 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &version{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } +// ClusterTriggerAuthentications returns a ClusterTriggerAuthenticationInformer. +func (v *version) ClusterTriggerAuthentications() ClusterTriggerAuthenticationInformer { + return &clusterTriggerAuthenticationInformer{factory: v.factory, tweakListOptions: v.tweakListOptions} +} + // ScaledJobs returns a ScaledJobInformer. func (v *version) ScaledJobs() ScaledJobInformer { return &scaledJobInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/generated/listers/keda/v1alpha1/clustertriggerauthentication.go b/pkg/generated/listers/keda/v1alpha1/clustertriggerauthentication.go new file mode 100644 index 00000000000..3e007175679 --- /dev/null +++ b/pkg/generated/listers/keda/v1alpha1/clustertriggerauthentication.go @@ -0,0 +1,65 @@ +/* +Copyright 2020 The KEDA 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. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha1 + +import ( + v1alpha1 "github.com/kedacore/keda/v2/api/v1alpha1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// ClusterTriggerAuthenticationLister helps list ClusterTriggerAuthentications. +type ClusterTriggerAuthenticationLister interface { + // List lists all ClusterTriggerAuthentications in the indexer. + List(selector labels.Selector) (ret []*v1alpha1.ClusterTriggerAuthentication, err error) + // Get retrieves the ClusterTriggerAuthentication from the index for a given name. + Get(name string) (*v1alpha1.ClusterTriggerAuthentication, error) + ClusterTriggerAuthenticationListerExpansion +} + +// clusterTriggerAuthenticationLister implements the ClusterTriggerAuthenticationLister interface. +type clusterTriggerAuthenticationLister struct { + indexer cache.Indexer +} + +// NewClusterTriggerAuthenticationLister returns a new ClusterTriggerAuthenticationLister. +func NewClusterTriggerAuthenticationLister(indexer cache.Indexer) ClusterTriggerAuthenticationLister { + return &clusterTriggerAuthenticationLister{indexer: indexer} +} + +// List lists all ClusterTriggerAuthentications in the indexer. +func (s *clusterTriggerAuthenticationLister) List(selector labels.Selector) (ret []*v1alpha1.ClusterTriggerAuthentication, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha1.ClusterTriggerAuthentication)) + }) + return ret, err +} + +// Get retrieves the ClusterTriggerAuthentication from the index for a given name. +func (s *clusterTriggerAuthenticationLister) Get(name string) (*v1alpha1.ClusterTriggerAuthentication, error) { + obj, exists, err := s.indexer.GetByKey(name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha1.Resource("clustertriggerauthentication"), name) + } + return obj.(*v1alpha1.ClusterTriggerAuthentication), nil +} diff --git a/pkg/generated/listers/keda/v1alpha1/expansion_generated.go b/pkg/generated/listers/keda/v1alpha1/expansion_generated.go index 6fa01fa5c08..b67e674283e 100644 --- a/pkg/generated/listers/keda/v1alpha1/expansion_generated.go +++ b/pkg/generated/listers/keda/v1alpha1/expansion_generated.go @@ -18,6 +18,10 @@ limitations under the License. package v1alpha1 +// ClusterTriggerAuthenticationListerExpansion allows custom methods to be added to +// ClusterTriggerAuthenticationLister. +type ClusterTriggerAuthenticationListerExpansion interface{} + // ScaledJobListerExpansion allows custom methods to be added to // ScaledJobLister. type ScaledJobListerExpansion interface{}