mirror of
https://github.com/traefik/traefik
synced 2026-02-03 12:20:33 +00:00
Make the aggregator compute provider namespace for router's parentRefs
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
@@ -42,10 +42,10 @@
|
||||
[http.routers.admin-router]
|
||||
rule = "Header(`X-User-Role`, `admin`)"
|
||||
service = "admin-service"
|
||||
parentRefs = ["parent-router@file"]
|
||||
parentRefs = ["parent-router"]
|
||||
|
||||
# Child router for developer role
|
||||
[http.routers.developer-router]
|
||||
rule = "Header(`X-User-Role`, `developer`)"
|
||||
service = "developer-service"
|
||||
parentRefs = ["parent-router@file"]
|
||||
parentRefs = ["parent-router"]
|
||||
|
||||
@@ -65,6 +65,16 @@ func mergeConfiguration(configurations dynamic.Configurations, defaultEntryPoint
|
||||
Msg("Router's `ruleSyntax` option is deprecated, please remove any usage of this option.")
|
||||
}
|
||||
|
||||
var qualifiedParentRefs []string
|
||||
for _, parentRef := range router.ParentRefs {
|
||||
if parts := strings.Split(parentRef, "@"); len(parts) == 1 {
|
||||
parentRef = provider.MakeQualifiedName(pvd, parentRef)
|
||||
}
|
||||
|
||||
qualifiedParentRefs = append(qualifiedParentRefs, parentRef)
|
||||
}
|
||||
router.ParentRefs = qualifiedParentRefs
|
||||
|
||||
conf.HTTP.Routers[provider.MakeQualifiedName(pvd, routerName)] = router
|
||||
}
|
||||
for middlewareName, middleware := range configuration.HTTP.Middlewares {
|
||||
|
||||
Reference in New Issue
Block a user