Skip to content

Commit

Permalink
Reduce spammy logs in route table (#8879)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseydavenport authored Jun 5, 2024
1 parent 53af413 commit 55743d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions felix/routerule/route_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ func (r *RouteRules) getActiveRule(rule *Rule, f RulesMatchFunc) *Rule {

// Set a Rule. Add to activeRules if it does not already exist based on matchForUpdate function.
func (r *RouteRules) SetRule(rule *Rule) {

if r.netlinkFamily != rule.nlRule.Family {
log.WithField("rule", rule).Warnf("Rule does not match family %d, ignoring.", r.netlinkFamily)
}
Expand All @@ -164,7 +163,6 @@ func (r *RouteRules) SetRule(rule *Rule) {

// Remove a Rule. Do nothing if Rule not exists depends based on matchForRemove function.
func (r *RouteRules) RemoveRule(rule *Rule) {

if r.netlinkFamily != rule.nlRule.Family {
log.WithField("rule", rule).Warnf("Rule does not match family %d, ignoring.", r.netlinkFamily)
}
Expand All @@ -186,7 +184,7 @@ func (r *RouteRules) getNetlinkHandle() (HandleIface, error) {
log.WithField("numFailures", r.numConsistentNetlinkFailures).Panic(
"Repeatedly failed to connect to netlink.")
}
log.Info("Trying to connect to netlink")
log.Debug("Trying to connect to netlink")
nlHandle, err := r.newNetlinkHandle()
if err != nil {
r.numConsistentNetlinkFailures++
Expand Down
8 changes: 4 additions & 4 deletions felix/routetable/route_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -891,19 +891,19 @@ func (r *RouteTable) fullResyncRoutesForLink(logCxt *log.Entry, ifaceName string
continue
}
logCxt := logCxt.WithField("cidr", cidr)
logCxt.Info("Deleting from expected targets")
logCxt.Debug("Deleting from expected targets")
delete(expectedTargets, cidr)

// If we do not have an update that supersedes this entry, then add it back in as an update so that we add
// the route.
if pendingTarget, ok := pendingDeltaTargets[cidr]; !ok {
logCxt.Info("No pending target update, adding back in as an update")
logCxt.Debug("No pending target update, adding back in as an update")
pendingDeltaTargets[cidr] = safeTargetPointer(target)
} else if pendingTarget == nil {
logCxt.Info("Pending target deletion, removing delete update")
logCxt.Debug("Pending target deletion, removing delete update")
delete(pendingDeltaTargets, cidr)
} else {
logCxt.Info("Pending target update, no changes to deltas required")
logCxt.Debug("Pending target update, no changes to deltas required")
}
}

Expand Down

0 comments on commit 55743d0

Please sign in to comment.