Introduce traefik.io API Group CRDs

This commit is contained in:
Romain 2023-03-20 15:38:08 +01:00 committed by GitHub
parent b3f162a8a6
commit 7af9d16208
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
298 changed files with 16218 additions and 582 deletions

View file

@ -29,7 +29,8 @@ package externalversions
import (
"fmt"
v1alpha1 "github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefik/v1alpha1"
v1alpha1 "github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefikcontainous/v1alpha1"
traefikiov1alpha1 "github.com/traefik/traefik/v2/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
@ -62,22 +63,42 @@ func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource
switch resource {
// Group=traefik.containo.us, Version=v1alpha1
case v1alpha1.SchemeGroupVersion.WithResource("ingressroutes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRoutes().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().IngressRoutes().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("ingressroutetcps"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRouteTCPs().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().IngressRouteTCPs().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("ingressrouteudps"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRouteUDPs().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().IngressRouteUDPs().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("middlewares"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().Middlewares().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().Middlewares().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("middlewaretcps"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().MiddlewareTCPs().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().MiddlewareTCPs().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("serverstransports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().ServersTransports().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().ServersTransports().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("tlsoptions"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().TLSOptions().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().TLSOptions().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("tlsstores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().TLSStores().Informer()}, nil
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().TLSStores().Informer()}, nil
case v1alpha1.SchemeGroupVersion.WithResource("traefikservices"):
return &genericInformer{resource: resource.GroupResource(), informer: f.TraefikContainous().V1alpha1().TraefikServices().Informer()}, nil
// Group=traefik.io, Version=v1alpha1
case traefikiov1alpha1.SchemeGroupVersion.WithResource("ingressroutes"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRoutes().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("ingressroutetcps"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRouteTCPs().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("ingressrouteudps"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().IngressRouteUDPs().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("middlewares"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().Middlewares().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("middlewaretcps"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().MiddlewareTCPs().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("serverstransports"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().ServersTransports().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("tlsoptions"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().TLSOptions().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("tlsstores"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().TLSStores().Informer()}, nil
case traefikiov1alpha1.SchemeGroupVersion.WithResource("traefikservices"):
return &genericInformer{resource: resource.GroupResource(), informer: f.Traefik().V1alpha1().TraefikServices().Informer()}, nil
}