mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-29 17:07:24 +02:00
upstream endpoints load balancer weights (#1830)
This commit is contained in:
parent
3567183ce5
commit
67f6030e1e
30 changed files with 1190 additions and 778 deletions
|
@ -83,7 +83,14 @@ func (src *ConfigSource) rebuild(firstTime bool) {
|
|||
|
||||
seen := map[uint64]struct{}{}
|
||||
for _, policy := range cfg.Options.GetAllPolicies() {
|
||||
seen[policy.RouteID()] = struct{}{}
|
||||
id, err := policy.RouteID()
|
||||
if err != nil {
|
||||
log.Warn().Err(err).
|
||||
Str("policy", policy.String()).
|
||||
Msg("databroker: invalid policy config, ignoring")
|
||||
return
|
||||
}
|
||||
seen[id] = struct{}{}
|
||||
}
|
||||
|
||||
var additionalPolicies []config.Policy
|
||||
|
@ -113,7 +120,13 @@ func (src *ConfigSource) rebuild(firstTime bool) {
|
|||
continue
|
||||
}
|
||||
|
||||
routeID := policy.RouteID()
|
||||
routeID, err := policy.RouteID()
|
||||
if err != nil {
|
||||
log.Warn().Err(err).
|
||||
Str("policy", policy.String()).
|
||||
Msg("databroker: cannot establish policy route ID, ignoring")
|
||||
continue
|
||||
}
|
||||
|
||||
if _, ok := seen[routeID]; ok {
|
||||
log.Warn().Err(err).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue