mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-21 10:38:08 +02:00
databroker: fix fast forward (#4194)
databroker: fix fast forward (#4192) * databroker: sort configs * databroker: fix fast-forward * newest not oldest Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
This commit is contained in:
parent
ca59798540
commit
4aa6960e06
4 changed files with 113 additions and 47 deletions
|
@ -81,7 +81,7 @@ func (src *ConfigSource) rebuild(ctx context.Context, firstTime firstTime) {
|
|||
// start the updater
|
||||
src.runUpdater(cfg)
|
||||
|
||||
seen := map[uint64]struct{}{}
|
||||
seen := map[uint64]string{}
|
||||
for _, policy := range cfg.Options.GetAllPolicies() {
|
||||
id, err := policy.RouteID()
|
||||
if err != nil {
|
||||
|
@ -90,7 +90,7 @@ func (src *ConfigSource) rebuild(ctx context.Context, firstTime firstTime) {
|
|||
Msg("databroker: invalid policy config, ignoring")
|
||||
return
|
||||
}
|
||||
seen[id] = struct{}{}
|
||||
seen[id] = ""
|
||||
}
|
||||
|
||||
var additionalPolicies []config.Policy
|
||||
|
@ -145,11 +145,12 @@ func (src *ConfigSource) rebuild(ctx context.Context, firstTime firstTime) {
|
|||
errCount++
|
||||
log.Warn(ctx).Err(err).
|
||||
Str("db_config_id", id).
|
||||
Str("seen-in", seen[routeID]).
|
||||
Str("policy", policy.String()).
|
||||
Msg("databroker: duplicate policy detected, ignoring")
|
||||
continue
|
||||
}
|
||||
seen[routeID] = struct{}{}
|
||||
seen[routeID] = id
|
||||
|
||||
additionalPolicies = append(additionalPolicies, *policy)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue