2020-09-16 14:19:51 +00:00
|
|
|
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2020-08-05 14:54:51 +00:00
|
|
|
|
|
|
|
// Code generated by informer-gen. DO NOT EDIT.
|
|
|
|
|
|
|
|
package externalversions
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2020-08-24 19:30:02 +00:00
|
|
|
v1alpha1 "github.com/suzerain-io/pinniped/generated/1.17/apis/crdpinniped/v1alpha1"
|
2020-09-01 16:55:33 +00:00
|
|
|
idpv1alpha1 "github.com/suzerain-io/pinniped/generated/1.17/apis/idp/v1alpha1"
|
2020-09-16 14:04:20 +00:00
|
|
|
loginv1alpha1 "github.com/suzerain-io/pinniped/generated/1.17/apis/login/v1alpha1"
|
2020-08-24 19:30:02 +00:00
|
|
|
pinnipedv1alpha1 "github.com/suzerain-io/pinniped/generated/1.17/apis/pinniped/v1alpha1"
|
2020-08-21 19:50:53 +00:00
|
|
|
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
|
|
|
cache "k8s.io/client-go/tools/cache"
|
2020-08-05 14:54:51 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
// GenericInformer is type of SharedIndexInformer which will locate and delegate to other
|
|
|
|
// sharedInformers based on type
|
|
|
|
type GenericInformer interface {
|
|
|
|
Informer() cache.SharedIndexInformer
|
|
|
|
Lister() cache.GenericLister
|
|
|
|
}
|
|
|
|
|
|
|
|
type genericInformer struct {
|
|
|
|
informer cache.SharedIndexInformer
|
|
|
|
resource schema.GroupResource
|
|
|
|
}
|
|
|
|
|
|
|
|
// Informer returns the SharedIndexInformer.
|
|
|
|
func (f *genericInformer) Informer() cache.SharedIndexInformer {
|
|
|
|
return f.informer
|
|
|
|
}
|
|
|
|
|
|
|
|
// Lister returns the GenericLister.
|
|
|
|
func (f *genericInformer) Lister() cache.GenericLister {
|
|
|
|
return cache.NewGenericLister(f.Informer().GetIndexer(), f.resource)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ForResource gives generic access to a shared informer of the matching type
|
|
|
|
// TODO extend this to unknown resources with a client pool
|
|
|
|
func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) {
|
|
|
|
switch resource {
|
2020-08-20 17:54:15 +00:00
|
|
|
// Group=crd.pinniped.dev, Version=v1alpha1
|
2020-08-21 16:55:44 +00:00
|
|
|
case v1alpha1.SchemeGroupVersion.WithResource("credentialissuerconfigs"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Crd().V1alpha1().CredentialIssuerConfigs().Informer()}, nil
|
2020-08-05 14:54:51 +00:00
|
|
|
|
2020-09-01 16:55:33 +00:00
|
|
|
// Group=idp.pinniped.dev, Version=v1alpha1
|
|
|
|
case idpv1alpha1.SchemeGroupVersion.WithResource("webhookidentityproviders"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.IDP().V1alpha1().WebhookIdentityProviders().Informer()}, nil
|
|
|
|
|
2020-09-16 14:04:20 +00:00
|
|
|
// Group=login.pinniped.dev, Version=v1alpha1
|
|
|
|
case loginv1alpha1.SchemeGroupVersion.WithResource("tokencredentialrequests"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Login().V1alpha1().TokenCredentialRequests().Informer()}, nil
|
|
|
|
|
2020-08-20 17:54:15 +00:00
|
|
|
// Group=pinniped.dev, Version=v1alpha1
|
|
|
|
case pinnipedv1alpha1.SchemeGroupVersion.WithResource("credentialrequests"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Pinniped().V1alpha1().CredentialRequests().Informer()}, nil
|
2020-08-05 14:54:51 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("no informer found for %v", resource)
|
|
|
|
}
|