Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong traefik 1 labels added #484

Open
yajo opened this issue Jul 24, 2024 · 8 comments
Open

Wrong traefik 1 labels added #484

yajo opened this issue Jul 24, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@yajo
Copy link
Contributor

yajo commented Jul 24, 2024

Describe the bug

If traefik 2 is chosen, traefik 1 labels are added with wrong format.

To Reproduce

Affected versions: 7.0.3

Steps to reproduce the behavior:

  1. Update to that version
  2. Select traefik 2

Traefik v1 labels are generated like this:

  traefik.forbiddenCrawlers-0.frontend.rule: Host(`one.example.com`);Path:/web,/web/{anything:.*},/website/info,/website/info/{anything:.*}
  traefik.main-0.frontend.rule: Host(`one.example.com`)
  traefik.longpolling-0.frontend.rule: Host(`one.example.com`);Path:/longpolling/{anything:.*}
  traefik.longpolling-0.port: 8072
  traefik.alt-1.frontend.redirect.regex: ^(.*)://([^/]+)/(.*)$$
  traefik.alt-1.frontend.redirect.replacement: $$1://one.example.com/$$3
  traefik.alt-1.frontend.rule: Host(`two.example.com`)

Expected behavior A clear and concise description of what you expected to happen.

Traefik v1 labels should either be removed (because I chose v2, after all) or be kept as they were before, like this:

  traefik.forbiddenCrawlers-0.frontend.rule: Host:one.example.com;Path:/web,/web/{anything:.*},/website/info,/website/info/{anything:.*}
  traefik.main-0.frontend.rule: Host:one.example.com
  traefik.longpolling-0.frontend.rule: Host:one.example.com;Path:/longpolling/{anything:.*}
  traefik.longpolling-0.port: 8072
  traefik.alt-1.frontend.redirect.regex: ^(.*)://([^/]+)/(.*)$$
  traefik.alt-1.frontend.redirect.replacement: $$1://one.example.com/$$3
  traefik.alt-1.frontend.rule: Host:two.example.com

Additional context Add any other context about the problem here. (e.g. OS, Docker
version, ...)
I don't use traefik v1.

@yajo yajo added the bug Something isn't working label Jul 24, 2024
@yajo
Copy link
Contributor Author

yajo commented Jul 24, 2024

FWIW the problem is only in prod.yaml. In test.yaml, traefik v1 labels are kept as expected.

@josep-tecnativa
Copy link
Contributor

I suppose what you are referring to is that the part Path:/web,/web/{anything:.*},/website/info,/website/info/{anything:.*} is in the syntax of Traefik 1.

If this is what you mean, it still works (since this was like this before we could choose the version and it was fully compatible with Traefik 2). That is, I understand that this syntax is still compatible with Traefik 2.

An improvement for using the new syntax would be to replace the old syntax with:

Host(one.example.com) && (PathPrefix(/web) || PathPrefix(/website/info))

Is this what you mean?

@yajo
Copy link
Contributor Author

yajo commented Jul 25, 2024

No, I just mean that the traefik v1 labels are invalid. They are using traefik v2 syntax.

Incorrect v1 syntax:

traefik.forbiddenCrawlers-0.frontend.rule: Host(`one.example.com`);Path:/web,/web/{anything:.*},/website/info,/website/info/{anything:.*}
traefik.main-0.frontend.rule: Host(`one.example.com`)
traefik.longpolling-0.frontend.rule: Host(`one.example.com`);Path:/longpolling/{anything:.*}
traefik.alt-1.frontend.rule: Host(`two.example.com`)

Correct v1 syntax:

traefik.forbiddenCrawlers-0.frontend.rule: Host:one.example.com;Path:/web,/web/{anything:.*},/website/info,/website/info/{anything:.*}
traefik.main-0.frontend.rule: Host:one.example.com
traefik.longpolling-0.frontend.rule: Host:one.example.com;Path:/longpolling/{anything:.*}
traefik.alt-1.frontend.rule: Host:two.example.com

@josep-tecnativa
Copy link
Contributor

I have tested, selecting Traefik v1 when is asked, and i get correct v1 syntax.
Have you selected Traefik v1 version when asked by template?
I would say that you have selected Traefik v2 version

@yajo
Copy link
Contributor Author

yajo commented Jul 25, 2024

Yes, I selected traefik v2, but the v1 labels got wrong v1 syntax.

@josep-tecnativa
Copy link
Contributor

I think I’m not understanding you. Just to know, why do you need Traefik 1 labels when using Traefik 2?

@josep-tecnativa
Copy link
Contributor

josep-tecnativa commented Jul 25, 2024

Do you mean just removing those rules when traefik 2 is selected?

@yajo
Copy link
Contributor Author

yajo commented Jul 25, 2024

Yes, they should be removed or fixed. But I guess removed would make more sense, when you choose v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants