2019-03-14 14:56:06 +00:00
|
|
|
/*
|
|
|
|
The MIT License (MIT)
|
|
|
|
|
|
|
|
Copyright (c) 2016-2019 Containous SAS
|
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
|
|
all copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// Code generated by informer-gen. DO NOT EDIT.
|
|
|
|
|
|
|
|
package externalversions
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2019-08-03 01:58:23 +00:00
|
|
|
v1alpha1 "github.com/containous/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
|
2019-03-14 14:56:06 +00:00
|
|
|
schema "k8s.io/apimachinery/pkg/runtime/schema"
|
|
|
|
cache "k8s.io/client-go/tools/cache"
|
|
|
|
)
|
|
|
|
|
|
|
|
// 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 {
|
2019-03-15 08:42:03 +00:00
|
|
|
// Group=traefik.containo.us, Version=v1alpha1
|
2019-03-14 14:56:06 +00:00
|
|
|
case v1alpha1.SchemeGroupVersion.WithResource("ingressroutes"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRoutes().Informer()}, nil
|
2019-06-11 13:12:04 +00:00
|
|
|
case v1alpha1.SchemeGroupVersion.WithResource("ingressroutetcps"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRouteTCPs().Informer()}, nil
|
2019-03-14 14:56:06 +00:00
|
|
|
case v1alpha1.SchemeGroupVersion.WithResource("middlewares"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().Middlewares().Informer()}, nil
|
2019-06-21 15:18:05 +00:00
|
|
|
case v1alpha1.SchemeGroupVersion.WithResource("tlsoptions"):
|
|
|
|
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().TLSOptions().Informer()}, nil
|
2019-03-15 08:42:03 +00:00
|
|
|
|
2019-03-14 14:56:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nil, fmt.Errorf("no informer found for %v", resource)
|
|
|
|
}
|