traefik / traefik-migration-tool

A migration tool from Traefik v1 to Traefik v2
https://docs.traefik.io/migration/v1-to-v2/
Apache License 2.0
151 stars 35 forks source link

Middlewares created with invalid names #26

Closed avnes closed 2 years ago

avnes commented 2 years ago

When running the traefik-migration-tool (from release v0.13.4) it will create a Middleware with a name from the rules match, and this can contain dots, and hence the Middleware is created with an invalid name, and the IngressRoute using that Middleware will not work.

Dest case: I have created a test case that shows this behaviour. Here are the test case files:

traefik-migration-tool-bug.zip

Steps to reproduce:

kubectl apply -f bug-setup.yaml
traefik-migration-tool ingress -i ingress.yaml -o output
mv output/ingress.yaml ingressroute.yaml
kubectl apply -f ingressroute.yaml 

When you now go to the Traefik Dashboard, you will notice that the new IngressRoute for "Host(somehost.somedomain.sometld) && PathPrefix(/nginx)" has an error status. If you investigate the error, you will see a screen like this:

migration-bug

Workaround: The workaround if of course to manually edit ingressroute.yaml prior to applying it, and ensure the name of the Middleware doesn't contain dots/period characters. But if you have a large number of ingresses to migrate done by various teams and persons, it is quite a high toil and high possibility of human errors.

Suggested fix: The traefik-migration-tool should replace all the dots in the Middleware name with dashes prior to saving the output file.

kevinpollet commented 2 years ago

Hello @avnes and thanks for your interest in Traefik,

The issue you are facing has been fixed by https://github.com/traefik/traefik/pull/8484 in Traefik and will be available in the upcoming release.

According to this, we will close this issue.