From 2943da5e0cef7049e384a2db81a263023adcf69f Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Larsen Date: Fri, 9 Feb 2024 15:21:08 +0100 Subject: [PATCH] Generate missing files Signed-off-by: Mikkel Oscar Lyderik Larsen --- docs/stack_crd.yaml | 16 +- docs/stackset_crd.yaml | 12 +- .../v1/fake/fake_platformcredentialsset.go | 142 +++++++++++++ .../zalando.org/v1/platformcredentialsset.go | 195 ++++++++++++++++++ .../zalando.org/v1/platformcredentialsset.go | 90 ++++++++ .../zalando.org/v1/platformcredentialsset.go | 99 +++++++++ 6 files changed, 540 insertions(+), 14 deletions(-) create mode 100644 pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_platformcredentialsset.go create mode 100644 pkg/client/clientset/versioned/typed/zalando.org/v1/platformcredentialsset.go create mode 100644 pkg/client/informers/externalversions/zalando.org/v1/platformcredentialsset.go create mode 100644 pkg/client/listers/zalando.org/v1/platformcredentialsset.go diff --git a/docs/stack_crd.yaml b/docs/stack_crd.yaml index 1de451a0..06ecd005 100644 --- a/docs/stack_crd.yaml +++ b/docs/stack_crd.yaml @@ -738,6 +738,14 @@ spec: In, NotIn, Exists and DoesNotExist. type: string values: + description: values is an array + of string values. If the operator + is In or NotIn, the values array + must be non-empty. If the operator + is Exists or DoesNotExist, the + values array must be empty. + This array is replaced during + a strategic merge patch. items: type: string type: array @@ -6604,14 +6612,6 @@ spec: In, NotIn, Exists and DoesNotExist. type: string values: - description: values is an array - of string values. If the operator - is In or NotIn, the values array - must be non-empty. If the operator - is Exists or DoesNotExist, the - values array must be empty. - This array is replaced during - a strategic merge patch. items: type: string type: array diff --git a/docs/stackset_crd.yaml b/docs/stackset_crd.yaml index 60d1d638..61b8adb0 100644 --- a/docs/stackset_crd.yaml +++ b/docs/stackset_crd.yaml @@ -997,12 +997,6 @@ spec: applies to. type: string operator: - description: operator - represents a key's relationship - to a set of values. - Valid operators are - In, NotIn, Exists and - DoesNotExist. type: string values: items: @@ -1059,6 +1053,12 @@ spec: applies to. type: string operator: + description: operator + represents a key's relationship + to a set of values. + Valid operators are + In, NotIn, Exists and + DoesNotExist. type: string values: items: diff --git a/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_platformcredentialsset.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_platformcredentialsset.go new file mode 100644 index 00000000..b80c18e3 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/zalando.org/v1/fake/fake_platformcredentialsset.go @@ -0,0 +1,142 @@ +/* +Copyright 2024 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + "context" + + zalandoorgv1 "github.com/zalando-incubator/stackset-controller/pkg/apis/zalando.org/v1" + 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" +) + +// FakePlatformCredentialsSets implements PlatformCredentialsSetInterface +type FakePlatformCredentialsSets struct { + Fake *FakeZalandoV1 + ns string +} + +var platformcredentialssetsResource = schema.GroupVersionResource{Group: "zalando.org", Version: "v1", Resource: "platformcredentialssets"} + +var platformcredentialssetsKind = schema.GroupVersionKind{Group: "zalando.org", Version: "v1", Kind: "PlatformCredentialsSet"} + +// Get takes name of the platformCredentialsSet, and returns the corresponding platformCredentialsSet object, and an error if there is any. +func (c *FakePlatformCredentialsSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *zalandoorgv1.PlatformCredentialsSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(platformcredentialssetsResource, c.ns, name), &zalandoorgv1.PlatformCredentialsSet{}) + + if obj == nil { + return nil, err + } + return obj.(*zalandoorgv1.PlatformCredentialsSet), err +} + +// List takes label and field selectors, and returns the list of PlatformCredentialsSets that match those selectors. +func (c *FakePlatformCredentialsSets) List(ctx context.Context, opts v1.ListOptions) (result *zalandoorgv1.PlatformCredentialsSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(platformcredentialssetsResource, platformcredentialssetsKind, c.ns, opts), &zalandoorgv1.PlatformCredentialsSetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &zalandoorgv1.PlatformCredentialsSetList{ListMeta: obj.(*zalandoorgv1.PlatformCredentialsSetList).ListMeta} + for _, item := range obj.(*zalandoorgv1.PlatformCredentialsSetList).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 platformCredentialsSets. +func (c *FakePlatformCredentialsSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(platformcredentialssetsResource, c.ns, opts)) + +} + +// Create takes the representation of a platformCredentialsSet and creates it. Returns the server's representation of the platformCredentialsSet, and an error, if there is any. +func (c *FakePlatformCredentialsSets) Create(ctx context.Context, platformCredentialsSet *zalandoorgv1.PlatformCredentialsSet, opts v1.CreateOptions) (result *zalandoorgv1.PlatformCredentialsSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(platformcredentialssetsResource, c.ns, platformCredentialsSet), &zalandoorgv1.PlatformCredentialsSet{}) + + if obj == nil { + return nil, err + } + return obj.(*zalandoorgv1.PlatformCredentialsSet), err +} + +// Update takes the representation of a platformCredentialsSet and updates it. Returns the server's representation of the platformCredentialsSet, and an error, if there is any. +func (c *FakePlatformCredentialsSets) Update(ctx context.Context, platformCredentialsSet *zalandoorgv1.PlatformCredentialsSet, opts v1.UpdateOptions) (result *zalandoorgv1.PlatformCredentialsSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(platformcredentialssetsResource, c.ns, platformCredentialsSet), &zalandoorgv1.PlatformCredentialsSet{}) + + if obj == nil { + return nil, err + } + return obj.(*zalandoorgv1.PlatformCredentialsSet), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePlatformCredentialsSets) UpdateStatus(ctx context.Context, platformCredentialsSet *zalandoorgv1.PlatformCredentialsSet, opts v1.UpdateOptions) (*zalandoorgv1.PlatformCredentialsSet, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(platformcredentialssetsResource, "status", c.ns, platformCredentialsSet), &zalandoorgv1.PlatformCredentialsSet{}) + + if obj == nil { + return nil, err + } + return obj.(*zalandoorgv1.PlatformCredentialsSet), err +} + +// Delete takes name of the platformCredentialsSet and deletes it. Returns an error if one occurs. +func (c *FakePlatformCredentialsSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(platformcredentialssetsResource, c.ns, name, opts), &zalandoorgv1.PlatformCredentialsSet{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePlatformCredentialsSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(platformcredentialssetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &zalandoorgv1.PlatformCredentialsSetList{}) + return err +} + +// Patch applies the patch and returns the patched platformCredentialsSet. +func (c *FakePlatformCredentialsSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *zalandoorgv1.PlatformCredentialsSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(platformcredentialssetsResource, c.ns, name, pt, data, subresources...), &zalandoorgv1.PlatformCredentialsSet{}) + + if obj == nil { + return nil, err + } + return obj.(*zalandoorgv1.PlatformCredentialsSet), err +} diff --git a/pkg/client/clientset/versioned/typed/zalando.org/v1/platformcredentialsset.go b/pkg/client/clientset/versioned/typed/zalando.org/v1/platformcredentialsset.go new file mode 100644 index 00000000..acc77a47 --- /dev/null +++ b/pkg/client/clientset/versioned/typed/zalando.org/v1/platformcredentialsset.go @@ -0,0 +1,195 @@ +/* +Copyright 2024 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. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + v1 "github.com/zalando-incubator/stackset-controller/pkg/apis/zalando.org/v1" + scheme "github.com/zalando-incubator/stackset-controller/pkg/client/clientset/versioned/scheme" + metav1 "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" +) + +// PlatformCredentialsSetsGetter has a method to return a PlatformCredentialsSetInterface. +// A group's client should implement this interface. +type PlatformCredentialsSetsGetter interface { + PlatformCredentialsSets(namespace string) PlatformCredentialsSetInterface +} + +// PlatformCredentialsSetInterface has methods to work with PlatformCredentialsSet resources. +type PlatformCredentialsSetInterface interface { + Create(ctx context.Context, platformCredentialsSet *v1.PlatformCredentialsSet, opts metav1.CreateOptions) (*v1.PlatformCredentialsSet, error) + Update(ctx context.Context, platformCredentialsSet *v1.PlatformCredentialsSet, opts metav1.UpdateOptions) (*v1.PlatformCredentialsSet, error) + UpdateStatus(ctx context.Context, platformCredentialsSet *v1.PlatformCredentialsSet, opts metav1.UpdateOptions) (*v1.PlatformCredentialsSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PlatformCredentialsSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PlatformCredentialsSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PlatformCredentialsSet, err error) + PlatformCredentialsSetExpansion +} + +// platformCredentialsSets implements PlatformCredentialsSetInterface +type platformCredentialsSets struct { + client rest.Interface + ns string +} + +// newPlatformCredentialsSets returns a PlatformCredentialsSets +func newPlatformCredentialsSets(c *ZalandoV1Client, namespace string) *platformCredentialsSets { + return &platformCredentialsSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the platformCredentialsSet, and returns the corresponding platformCredentialsSet object, and an error if there is any. +func (c *platformCredentialsSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PlatformCredentialsSet, err error) { + result = &v1.PlatformCredentialsSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("platformcredentialssets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PlatformCredentialsSets that match those selectors. +func (c *platformCredentialsSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PlatformCredentialsSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PlatformCredentialsSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("platformcredentialssets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested platformCredentialsSets. +func (c *platformCredentialsSets) Watch(ctx context.Context, opts metav1.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(). + Namespace(c.ns). + Resource("platformcredentialssets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a platformCredentialsSet and creates it. Returns the server's representation of the platformCredentialsSet, and an error, if there is any. +func (c *platformCredentialsSets) Create(ctx context.Context, platformCredentialsSet *v1.PlatformCredentialsSet, opts metav1.CreateOptions) (result *v1.PlatformCredentialsSet, err error) { + result = &v1.PlatformCredentialsSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("platformcredentialssets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(platformCredentialsSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a platformCredentialsSet and updates it. Returns the server's representation of the platformCredentialsSet, and an error, if there is any. +func (c *platformCredentialsSets) Update(ctx context.Context, platformCredentialsSet *v1.PlatformCredentialsSet, opts metav1.UpdateOptions) (result *v1.PlatformCredentialsSet, err error) { + result = &v1.PlatformCredentialsSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("platformcredentialssets"). + Name(platformCredentialsSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(platformCredentialsSet). + Do(ctx). + Into(result) + return +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *platformCredentialsSets) UpdateStatus(ctx context.Context, platformCredentialsSet *v1.PlatformCredentialsSet, opts metav1.UpdateOptions) (result *v1.PlatformCredentialsSet, err error) { + result = &v1.PlatformCredentialsSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("platformcredentialssets"). + Name(platformCredentialsSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(platformCredentialsSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the platformCredentialsSet and deletes it. Returns an error if one occurs. +func (c *platformCredentialsSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("platformcredentialssets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *platformCredentialsSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("platformcredentialssets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched platformCredentialsSet. +func (c *platformCredentialsSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PlatformCredentialsSet, err error) { + result = &v1.PlatformCredentialsSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("platformcredentialssets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/pkg/client/informers/externalversions/zalando.org/v1/platformcredentialsset.go b/pkg/client/informers/externalversions/zalando.org/v1/platformcredentialsset.go new file mode 100644 index 00000000..6309efab --- /dev/null +++ b/pkg/client/informers/externalversions/zalando.org/v1/platformcredentialsset.go @@ -0,0 +1,90 @@ +/* +Copyright 2024 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. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1 + +import ( + "context" + time "time" + + zalandoorgv1 "github.com/zalando-incubator/stackset-controller/pkg/apis/zalando.org/v1" + versioned "github.com/zalando-incubator/stackset-controller/pkg/client/clientset/versioned" + internalinterfaces "github.com/zalando-incubator/stackset-controller/pkg/client/informers/externalversions/internalinterfaces" + v1 "github.com/zalando-incubator/stackset-controller/pkg/client/listers/zalando.org/v1" + metav1 "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" +) + +// PlatformCredentialsSetInformer provides access to a shared informer and lister for +// PlatformCredentialsSets. +type PlatformCredentialsSetInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1.PlatformCredentialsSetLister +} + +type platformCredentialsSetInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewPlatformCredentialsSetInformer constructs a new informer for PlatformCredentialsSet 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 NewPlatformCredentialsSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredPlatformCredentialsSetInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredPlatformCredentialsSetInformer constructs a new informer for PlatformCredentialsSet 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 NewFilteredPlatformCredentialsSetInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options metav1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ZalandoV1().PlatformCredentialsSets(namespace).List(context.TODO(), options) + }, + WatchFunc: func(options metav1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.ZalandoV1().PlatformCredentialsSets(namespace).Watch(context.TODO(), options) + }, + }, + &zalandoorgv1.PlatformCredentialsSet{}, + resyncPeriod, + indexers, + ) +} + +func (f *platformCredentialsSetInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredPlatformCredentialsSetInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *platformCredentialsSetInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&zalandoorgv1.PlatformCredentialsSet{}, f.defaultInformer) +} + +func (f *platformCredentialsSetInformer) Lister() v1.PlatformCredentialsSetLister { + return v1.NewPlatformCredentialsSetLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/listers/zalando.org/v1/platformcredentialsset.go b/pkg/client/listers/zalando.org/v1/platformcredentialsset.go new file mode 100644 index 00000000..cbb66ae3 --- /dev/null +++ b/pkg/client/listers/zalando.org/v1/platformcredentialsset.go @@ -0,0 +1,99 @@ +/* +Copyright 2024 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. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1 + +import ( + v1 "github.com/zalando-incubator/stackset-controller/pkg/apis/zalando.org/v1" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// PlatformCredentialsSetLister helps list PlatformCredentialsSets. +// All objects returned here must be treated as read-only. +type PlatformCredentialsSetLister interface { + // List lists all PlatformCredentialsSets in the indexer. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PlatformCredentialsSet, err error) + // PlatformCredentialsSets returns an object that can list and get PlatformCredentialsSets. + PlatformCredentialsSets(namespace string) PlatformCredentialsSetNamespaceLister + PlatformCredentialsSetListerExpansion +} + +// platformCredentialsSetLister implements the PlatformCredentialsSetLister interface. +type platformCredentialsSetLister struct { + indexer cache.Indexer +} + +// NewPlatformCredentialsSetLister returns a new PlatformCredentialsSetLister. +func NewPlatformCredentialsSetLister(indexer cache.Indexer) PlatformCredentialsSetLister { + return &platformCredentialsSetLister{indexer: indexer} +} + +// List lists all PlatformCredentialsSets in the indexer. +func (s *platformCredentialsSetLister) List(selector labels.Selector) (ret []*v1.PlatformCredentialsSet, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PlatformCredentialsSet)) + }) + return ret, err +} + +// PlatformCredentialsSets returns an object that can list and get PlatformCredentialsSets. +func (s *platformCredentialsSetLister) PlatformCredentialsSets(namespace string) PlatformCredentialsSetNamespaceLister { + return platformCredentialsSetNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// PlatformCredentialsSetNamespaceLister helps list and get PlatformCredentialsSets. +// All objects returned here must be treated as read-only. +type PlatformCredentialsSetNamespaceLister interface { + // List lists all PlatformCredentialsSets in the indexer for a given namespace. + // Objects returned here must be treated as read-only. + List(selector labels.Selector) (ret []*v1.PlatformCredentialsSet, err error) + // Get retrieves the PlatformCredentialsSet from the indexer for a given namespace and name. + // Objects returned here must be treated as read-only. + Get(name string) (*v1.PlatformCredentialsSet, error) + PlatformCredentialsSetNamespaceListerExpansion +} + +// platformCredentialsSetNamespaceLister implements the PlatformCredentialsSetNamespaceLister +// interface. +type platformCredentialsSetNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all PlatformCredentialsSets in the indexer for a given namespace. +func (s platformCredentialsSetNamespaceLister) List(selector labels.Selector) (ret []*v1.PlatformCredentialsSet, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1.PlatformCredentialsSet)) + }) + return ret, err +} + +// Get retrieves the PlatformCredentialsSet from the indexer for a given namespace and name. +func (s platformCredentialsSetNamespaceLister) Get(name string) (*v1.PlatformCredentialsSet, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1.Resource("platformcredentialsset"), name) + } + return obj.(*v1.PlatformCredentialsSet), nil +}