mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-11-20 12:31:04 +01:00
feat(NPC): minor performance improvement
Don't continue the loop if we've already matched.
This commit is contained in:
parent
5156f878d6
commit
031d75265b
@ -441,11 +441,13 @@ func (npc *NetworkPolicyController) cleanupStaleRules(activePolicyChains, active
|
|||||||
}
|
}
|
||||||
if _, ok := activePolicyChains[chain]; !ok {
|
if _, ok := activePolicyChains[chain]; !ok {
|
||||||
cleanupPolicyChains = append(cleanupPolicyChains, chain)
|
cleanupPolicyChains = append(cleanupPolicyChains, chain)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(chain, kubePodFirewallChainPrefix) {
|
if strings.HasPrefix(chain, kubePodFirewallChainPrefix) {
|
||||||
if _, ok := activePodFwChains[chain]; !ok {
|
if _, ok := activePodFwChains[chain]; !ok {
|
||||||
cleanupPodFwChains = append(cleanupPodFwChains, chain)
|
cleanupPodFwChains = append(cleanupPodFwChains, chain)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user