Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve EndpointLookupsCache occupancy #9876

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions felix/calc/active_rules_calculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ type FelixSender interface {
}

type PolicyMatchListener interface {
OnPolicyMatch(policyKey model.PolicyKey, endpointKey model.Key)
OnPolicyMatchStopped(policyKey model.PolicyKey, endpointKey model.Key)
OnPolicyMatch(policyKey model.PolicyKey, endpointKey model.EndpointKey)
OnPolicyMatchStopped(policyKey model.PolicyKey, endpointKey model.EndpointKey)
}

// ActiveRulesCalculator calculates the set of policies and profiles (i.e. the rules) that
Expand Down Expand Up @@ -364,7 +364,7 @@ func (arc *ActiveRulesCalculator) onMatchStarted(selID, labelId interface{}) {
}
arc.sendPolicyUpdate(polKey, policy)
}
if labelId, ok := labelId.(model.Key); ok {
if labelId, ok := labelId.(model.EndpointKey); ok {
for _, l := range arc.PolicyMatchListeners {
l.OnPolicyMatch(polKey, labelId)
}
Expand All @@ -381,7 +381,7 @@ func (arc *ActiveRulesCalculator) onMatchStopped(selID, labelId interface{}) {
policy, _ := arc.allPolicies.Get(polKey)
arc.sendPolicyUpdate(polKey, policy)
}
if labelId, ok := labelId.(model.Key); ok {
if labelId, ok := labelId.(model.EndpointKey); ok {
for _, l := range arc.PolicyMatchListeners {
l.OnPolicyMatchStopped(polKey, labelId)
}
Expand Down
4 changes: 1 addition & 3 deletions felix/calc/calc_graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ type rulesUpdateCallbacks interface {
}

type endpointCallbacks interface {
OnEndpointTierUpdate(endpointKey model.Key,
endpoint interface{},
filteredTiers []TierInfo)
OnEndpointTierUpdate(endpointKey model.EndpointKey, endpoint model.Endpoint, filteredTiers []TierInfo)
}

type configCallbacks interface {
Expand Down
Loading