-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use exact service name match searching container labels
`findContainerByServiceName` incorrectly matched containers based on service and router names when there were two services with similar names, specifically when one service name was a prefix of the other. Add a dot to the service and router needles and compare the labels with HasPrefix() to ensure that only the exact matches get picked up.
- Loading branch information
Damien Fleurisson
committed
Jul 7, 2024
1 parent
7f76a08
commit 7db2c37
Showing
3 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
services: | ||
hello: | ||
image: helloworld | ||
restart: unless-stopped | ||
ports: | ||
- 5555:5555 | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.hello.rule=Host(`hello.local`)" | ||
- "traefik.http.routers.hello.service=hello" | ||
- "traefik.http.routers.hello.tls=true" | ||
- "traefik.http.routers.hello.tls.certresolver=default" | ||
- "traefik.http.services.hello.loadbalancer.server.scheme=http" | ||
- "traefik.http.services.hello.loadbalancer.server.port=5555" | ||
|
||
hello-test: | ||
image: helloworld | ||
restart: unless-stopped | ||
ports: | ||
- 5566:5566 | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.hello-test.rule=Host(`hello-test.local`)" | ||
- "traefik.http.routers.hello-test.service=hello-test" | ||
- "traefik.http.routers.hello-test.tls=true" | ||
- "traefik.http.routers.hello-test.tls.certresolver=default" | ||
- "traefik.http.services.hello-test.loadbalancer.server.scheme=http" | ||
- "traefik.http.services.hello-test.loadbalancer.server.port=5566" |