Make the aggregator compute provider namespace for router's parentRefs
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
parent
83beb8a19c
commit
9e04dd6a3c
2 changed files with 12 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue