From d582e01892b3a0f1c6106c40dbe6ee7d9e512c6b Mon Sep 17 00:00:00 2001 From: Julien Salleyron Date: Fri, 15 Mar 2024 09:24:03 +0100 Subject: [PATCH] runtime.Object in routerTransform Co-authored-by: lbenguigui --- pkg/provider/kubernetes/crd/kubernetes.go | 2 +- pkg/provider/kubernetes/gateway/kubernetes.go | 2 +- pkg/provider/kubernetes/ingress/kubernetes.go | 2 +- pkg/provider/kubernetes/k8s/router_transform.go | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/provider/kubernetes/crd/kubernetes.go b/pkg/provider/kubernetes/crd/kubernetes.go index 46f0b628f..55ca2aba5 100644 --- a/pkg/provider/kubernetes/crd/kubernetes.go +++ b/pkg/provider/kubernetes/crd/kubernetes.go @@ -73,7 +73,7 @@ func (p *Provider) applyRouterTransform(ctx context.Context, rt *dynamic.Router, return } - err := p.routerTransform.Apply(ctx, rt, ingress.Annotations) + err := p.routerTransform.Apply(ctx, rt, ingress) if err != nil { log.Ctx(ctx).Error().Err(err).Msg("Apply router transform") } diff --git a/pkg/provider/kubernetes/gateway/kubernetes.go b/pkg/provider/kubernetes/gateway/kubernetes.go index 724d5b841..56cb4f952 100644 --- a/pkg/provider/kubernetes/gateway/kubernetes.go +++ b/pkg/provider/kubernetes/gateway/kubernetes.go @@ -73,7 +73,7 @@ func (p *Provider) applyRouterTransform(ctx context.Context, rt *dynamic.Router, return } - err := p.routerTransform.Apply(ctx, rt, route.Annotations) + err := p.routerTransform.Apply(ctx, rt, route) if err != nil { log.Ctx(ctx).Error().Err(err).Msg("Apply router transform") } diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go index de0c24e5a..99a8351f8 100644 --- a/pkg/provider/kubernetes/ingress/kubernetes.go +++ b/pkg/provider/kubernetes/ingress/kubernetes.go @@ -67,7 +67,7 @@ func (p *Provider) applyRouterTransform(ctx context.Context, rt *dynamic.Router, return } - err := p.routerTransform.Apply(ctx, rt, ingress.Annotations) + err := p.routerTransform.Apply(ctx, rt, ingress) if err != nil { log.Ctx(ctx).Error().Err(err).Msg("Apply router transform") } diff --git a/pkg/provider/kubernetes/k8s/router_transform.go b/pkg/provider/kubernetes/k8s/router_transform.go index ff1b2e1a1..18a410282 100644 --- a/pkg/provider/kubernetes/k8s/router_transform.go +++ b/pkg/provider/kubernetes/k8s/router_transform.go @@ -4,8 +4,9 @@ import ( "context" "github.com/traefik/traefik/v3/pkg/config/dynamic" + "k8s.io/apimachinery/pkg/runtime" ) type RouterTransform interface { - Apply(ctx context.Context, rt *dynamic.Router, annotations map[string]string) error + Apply(ctx context.Context, rt *dynamic.Router, object runtime.Object) error }